From 63487505c678152e59847e3ab7878ea5f2514dfa Mon Sep 17 00:00:00 2001 From: jaubourg Date: Sun, 9 Jan 2011 06:19:27 +0100 Subject: [PATCH] Added a test for retrying a request on error using jQuery.ajax(this). Works as intended. Fixes #7461. --- test/unit/ajax.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/test/unit/ajax.js b/test/unit/ajax.js index 14f8928..4c8c500 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 ); -- 1.7.10.4