X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=test%2Funit%2Fajax.js;h=9e6f32de292e8808d4151523ce7009e61adbc135;hb=a2c2d68d7f29eb543d937a72bdf4b5399b7aa14a;hp=b2e51fbcf3bcf573cd5f74ddff49fecde583edb3;hpb=de58db0cdf4dc08db8683ad6cd0035c5d64b26ac;p=jquery.git diff --git a/test/unit/ajax.js b/test/unit/ajax.js index b2e51fb..9e6f32d 100644 --- a/test/unit/ajax.js +++ b/test/unit/ajax.js @@ -137,7 +137,7 @@ test(".load()) - 404 error callbacks", function() { }); test("jQuery.ajax() - abort", function() { - expect( 6 ); + expect( 8 ); stop(); jQuery('#foo').ajaxStart(function(){ @@ -157,7 +157,10 @@ test("jQuery.ajax() - abort", function() { complete: function(){ ok(true, "complete"); } }); + equals( xhr.readyState, 1, "XHR readyState indicates successful dispatch" ); + xhr.abort(); + equals( xhr.readyState, 0, "XHR readyState indicates successful abortion" ); }); test("Ajax events with context", function() { @@ -707,10 +710,10 @@ test("jQuery.getScript(String, Function) - no callback", function() { }); test("jQuery.ajax() - JSONP, Local", function() { - expect(8); + expect(9); var count = 0; - function plus(){ if ( ++count == 8 ) start(); } + function plus(){ if ( ++count == 9 ) start(); } stop(); @@ -825,6 +828,17 @@ test("jQuery.ajax() - JSONP, Local", function() { plus(); } }); + + //#7578 + jQuery.ajax({ + url: "data/jsonp.php", + dataType: "jsonp", + beforeSend: function(){ + strictEqual( this.cache, false, "cache must be false on JSON request" ); + plus(); + return false; + } + }); }); test("JSONP - Custom JSONP Callback", function() {