X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fajax.js;h=7f3f39aff46c370ceed5e25c47f940fce8b83bdb;hb=0b4b3ee8a5eda75d8399b333cda54f6b319fe74c;hp=be4b3f0219b656356737aaf6eb6598f03de46864;hpb=273822c138c70b1d58e2d1199090e9efa3e0e53e;p=jquery.git diff --git a/test/unit/ajax.js b/test/unit/ajax.js index be4b3f0..7f3f39a 100644 --- a/test/unit/ajax.js +++ b/test/unit/ajax.js @@ -68,6 +68,18 @@ test("jQuery.ajax() - error callbacks", function() { }); }); +test(".ajax() - 304", function() { + expect( 1 ); + stop(); + + jQuery.ajax({ + url: url("data/notmodified.php"), + success: function(){ ok(true, "304 ok"); }, + error: function(){ ok(false, "304 not ok "); }, + complete: function(xhr){ start(); } + }); +}); + test(".load()) - 404 error callbacks", function() { expect( 6 ); stop(); @@ -1163,6 +1175,19 @@ test("data option: evaluate function values (#2806)", function() { }) }); +test("data option: empty bodies for non-GET requests", function() { + stop(); + jQuery.ajax({ + url: "data/echoData.php", + data: undefined, + type: "post", + success: function(result) { + equals( result, "" ); + start(); + } + }) +}); + test("jQuery.ajax - If-Modified-Since support", function() { expect( 3 ); @@ -1225,6 +1250,12 @@ 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 ); +}); + + } //}