aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorDan Heberden <danheberden@gmail.com>2011-02-01 00:18:16 -0800
committerDan Heberden <danheberden@gmail.com>2011-02-01 00:22:22 -0800
commitaf70dee88e374d27dd8c0c8ec18af5c89541d4c9 (patch)
tree94e6762f87d2a1c7c9f3f57fda75893c228e3ad7 /test/unit
parent31949fa528141dad4b92851212677b039cb23cfb (diff)
downloadjquery-af70dee88e374d27dd8c0c8ec18af5c89541d4c9.tar.gz
jquery-af70dee88e374d27dd8c0c8ec18af5c89541d4c9.zip
Improve $.ajax method signature unit test and placement
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/ajax.js34
1 files changed, 15 insertions, 19 deletions
diff --git a/test/unit/ajax.js b/test/unit/ajax.js
index 25e021873..ad14d0a98 100644
--- a/test/unit/ajax.js
+++ b/test/unit/ajax.js
@@ -38,6 +38,21 @@ test("jQuery.ajax() - success callbacks", function() {
});
});
+test( "jQuery.ajax - multiple method signatures introduced in 1.5 ( #8107)", function() {
+
+ expect( 4 );
+
+ stop();
+
+ jQuery.when(
+ jQuery.ajax().success(function() { ok( true, 'With no arguments' ); }),
+ jQuery.ajax('data/name.html').success(function() { ok( true, 'With only string URL argument' ); }),
+ jQuery.ajax('data/name.html', {} ).success(function() { ok( true, 'With string URL param and map' ); }),
+ jQuery.ajax({ url: 'data/name.html'} ).success(function() { ok( true, 'With only map' ); })
+ ).then( start, start );
+
+});
+
test("jQuery.ajax() - success callbacks - (url, options) syntax", function() {
expect( 8 );
@@ -2161,25 +2176,6 @@ test("jQuery.ajax - active counter", function() {
ok( jQuery.active == 0, "ajax active counter should be zero: " + jQuery.active );
});
-test( "jQuery.ajax - multiple method signatures introduced in 1.5 ( #8107)", 4, function() {
-
- expect( 3 );
-
- var i = 3;
-
- jQuery.ajaxSetup({success: function() {
- ok( true, "Success");
- if ( ! --i ) start();
- }});
-
- stop();
- jQuery.ajax('data/name.html');
- jQuery.ajax('data/name.html', {} );
- jQuery.ajax({ url: 'data/name.html'} );
-
- jQuery.ajaxSetup({ success: null });
-});
-
}
//} \ No newline at end of file