aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorjeresig <jeresig@gmail.com>2010-01-06 12:13:56 -0500
committerjeresig <jeresig@gmail.com>2010-01-06 12:13:56 -0500
commit84dd82eb1a295e8671a98ebf5a854dbac63caf78 (patch)
treecbdf020b70d9c1fc41853dc4ba9114d64c3fe2df /test
parente424e01c47084f29d83a643cc5540fd37b85c68d (diff)
downloadjquery-84dd82eb1a295e8671a98ebf5a854dbac63caf78.tar.gz
jquery-84dd82eb1a295e8671a98ebf5a854dbac63caf78.zip
Add some abort() Ajax tests. Verifies that #3984 works.
Diffstat (limited to 'test')
-rw-r--r--test/unit/ajax.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/unit/ajax.js b/test/unit/ajax.js
index 9b1e3238f..33937804b 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);