Skip to content

Commit

Permalink
Add some abort() Ajax tests. Verifies that #3984 works.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeresig committed Jan 6, 2010
1 parent e424e01 commit 84dd82e
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/unit/ajax.js
Expand Up @@ -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);

Expand Down

0 comments on commit 84dd82e

Please sign in to comment.