X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fajax.js;h=33937804ba46312696022f064d8392d50dd67f06;hb=84dd82eb1a295e8671a98ebf5a854dbac63caf78;hp=9b1e3238f2670cd60d2ffe4ff7cc53692cc34c56;hpb=e424e01c47084f29d83a643cc5540fd37b85c68d;p=jquery.git diff --git a/test/unit/ajax.js b/test/unit/ajax.js index 9b1e323..3393780 100644 --- a/test/unit/ajax.js +++ b/test/unit/ajax.js @@ -70,6 +70,30 @@ test("jQuery.ajax() - error callbacks", function() { }); }); +test("jQuery.ajax() - abort", function() { + expect( 6 ); + stop(); + + jQuery('#foo').ajaxStart(function(){ + ok( true, "ajaxStart" ); + }).ajaxStop(function(){ + ok( true, "ajaxStop" ); + start(); + }).ajaxSend(function(){ + ok( true, "ajaxSend" ); + }).ajaxComplete(function(){ + ok( true, "ajaxComplete" ); + }); + + var xhr = jQuery.ajax({ + url: url("data/name.php?wait=5"), + beforeSend: function(){ ok(true, "beforeSend"); }, + complete: function(){ ok(true, "complete"); } + }); + + xhr.abort(); +}); + test("Ajax events with context", function() { expect(6);