Places multiple signature test after all primary callbacks tests.
[jquery.git] / test / unit / ajax.js
index 25e0218..b51419d 100644 (file)
@@ -240,6 +240,21 @@ test("jQuery.ajax() - error 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() - textStatus and errorThrown values", function() {
 
        var nb = 2;
@@ -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