X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fajax.js;h=b0c399b302e98f1524b80022f7640162e662175c;hb=2a0c7d702b83a6b2e40eb79a5d6ea94d74f3090d;hp=b2e51fbcf3bcf573cd5f74ddff49fecde583edb3;hpb=de58db0cdf4dc08db8683ad6cd0035c5d64b26ac;p=jquery.git diff --git a/test/unit/ajax.js b/test/unit/ajax.js index b2e51fb..b0c399b 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() { @@ -1347,6 +1350,16 @@ test("jQuery.ajax - active counter", function() { ok( jQuery.active == 0, "ajax active counter should be zero: " + jQuery.active ); }); +test( "jQuery.ajax - Location object as url (#7531)", 1, function () { + var success = false; + try { + var xhr = jQuery.ajax({ url: document.location }); + success = true; + xhr.abort(); + } catch (e) {} + + ok( success, "document.location did not generate exception" ); +}); }