diff options
author | jaubourg <j@ubourg.net> | 2011-01-09 06:19:27 +0100 |
---|---|---|
committer | jaubourg <j@ubourg.net> | 2011-01-09 06:19:27 +0100 |
commit | 63487505c678152e59847e3ab7878ea5f2514dfa (patch) | |
tree | 0b4c6c9b5fb10c2402c9a917d23246f4e75bd14a /test/unit/ajax.js | |
parent | afefb4f3d28f47c0a93cc9dfddfcbadb595a8efb (diff) | |
download | jquery-63487505c678152e59847e3ab7878ea5f2514dfa.tar.gz jquery-63487505c678152e59847e3ab7878ea5f2514dfa.zip |
Added a test for retrying a request on error using jQuery.ajax(this). Works as intended. Fixes #7461.
Diffstat (limited to 'test/unit/ajax.js')
-rw-r--r-- | test/unit/ajax.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/unit/ajax.js b/test/unit/ajax.js index 14f892857..4c8c5009b 100644 --- a/test/unit/ajax.js +++ b/test/unit/ajax.js @@ -257,6 +257,29 @@ test("jQuery.ajax() - responseText on error", function() { }); }); +test(".ajax() - retry with jQuery.ajax( this )", function() { + + expect( 1 ); + + stop(); + + var firstTime = 1; + + jQuery.ajax({ + url: url("data/errorWithText.php"), + error: function() { + if ( firstTime ) { + firstTime = 0; + jQuery.ajax( this ); + } else { + ok( true , "Test retrying with jQuery.ajax(this) works" ); + start(); + } + } + }) + +}); + test(".ajax() - headers" , function() { expect( 2 ); |