Skip to content
Permalink
Browse files

Added a test for retrying a request on error using jQuery.ajax(this).…

… Works as intended. Fixes #7461.
  • Loading branch information
jaubourg committed Jan 9, 2011
1 parent afefb4f commit 63487505c678152e59847e3ab7878ea5f2514dfa
Showing with 23 additions and 0 deletions.
  1. +23 −0 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 );

0 comments on commit 6348750

Please sign in to comment.
You can’t perform that action at this time.