X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fajax.js;h=b2e51fbcf3bcf573cd5f74ddff49fecde583edb3;hb=fb4445070cd9e06929c7b6f27c10dbf42d4a3367;hp=2ded1277644e2ec9dd8728a55e4b1c186b2a3539;hpb=26db3f09331d0d69340d745a1e51d5e03a6eddb9;p=jquery.git diff --git a/test/unit/ajax.js b/test/unit/ajax.js index 2ded127..b2e51fb 100644 --- a/test/unit/ajax.js +++ b/test/unit/ajax.js @@ -289,6 +289,32 @@ test("jQuery.ajax - xml: non-namespace elements inside namespaced elements", fun }); }); +test("jQuery.ajax - HEAD requests", function() { + expect(2); + + stop(); + jQuery.ajax({ + url: url("data/name.html"), + type: "HEAD", + success: function(data, status, xhr){ + var h = xhr.getAllResponseHeaders(); + ok( /Date/i.test(h), 'No Date in HEAD response' ); + + jQuery.ajax({ + url: url("data/name.html"), + data: { whip_it: "good" }, + type: "HEAD", + success: function(data, status, xhr){ + var h = xhr.getAllResponseHeaders(); + ok( /Date/i.test(h), 'No Date in HEAD response with data' ); + start(); + } + }); + } + }); + +}); + test("jQuery.ajax - beforeSend", function() { expect(1); stop(); @@ -1318,7 +1344,7 @@ test("jQuery.ajax - Etag support", function() { }); test("jQuery.ajax - active counter", function() { - ok( jQuery.ajax.active == 0, "ajax active counter should be zero: " + jQuery.ajax.active ); + ok( jQuery.active == 0, "ajax active counter should be zero: " + jQuery.active ); });