diff options
author | jaubourg <j@ubourg.net> | 2011-07-01 02:11:26 +0200 |
---|---|---|
committer | jaubourg <j@ubourg.net> | 2011-07-01 02:11:26 +0200 |
commit | e83fcdcb02d676d91d764a58f7e8d2eb1c95de69 (patch) | |
tree | c17e96b3e97305bf9c93d2d9bc4cdc88971137e4 /test/unit/ajax.js | |
parent | 139135a98aab1c422e5ae05b026535a40d58328f (diff) | |
download | jquery-e83fcdcb02d676d91d764a58f7e8d2eb1c95de69.tar.gz jquery-e83fcdcb02d676d91d764a58f7e8d2eb1c95de69.zip |
Fixes #9682. Removes data from the options for request with no content so that it is not used again in case of a retry. Unit test added.
Diffstat (limited to 'test/unit/ajax.js')
-rw-r--r-- | test/unit/ajax.js | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/test/unit/ajax.js b/test/unit/ajax.js index 9f084136e..334339227 100644 --- a/test/unit/ajax.js +++ b/test/unit/ajax.js @@ -321,25 +321,40 @@ test("jQuery.ajax() - responseText on error", function() { test(".ajax() - retry with jQuery.ajax( this )", function() { - expect( 1 ); + expect( 2 ); stop(); - var firstTime = 1; + var firstTime = true, + previousUrl; jQuery.ajax({ url: url("data/errorWithText.php"), error: function() { if ( firstTime ) { - firstTime = 0; + firstTime = false; jQuery.ajax( this ); } else { ok( true , "Test retrying with jQuery.ajax(this) works" ); - start(); + jQuery.ajax({ + url: url("data/errorWithText.php"), + data: { x: 1 }, + beforeSend: function() { + if ( !previousUrl ) { + previousUrl = this.url; + } else { + strictEqual( this.url , previousUrl, "url parameters are not re-appended" ); + start(); + return false; + } + }, + error: function() { + jQuery.ajax( this ); + } + }); } } }); - }); test(".ajax() - headers" , function() { |