X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fajax%2FajaxTest.js;h=851be5163d1dd49865dc5a75cf83e9741844f5ba;hb=7e03645a5534fc582847df6ece72aec516487b47;hp=5eea9b80aa9b1b60ac57a586d38492624f68ede2;hpb=8ac2169dc01f646b9182a03353427f2c48cba49c;p=jquery.git diff --git a/src/ajax/ajaxTest.js b/src/ajax/ajaxTest.js index 5eea9b8..851be51 100644 --- a/src/ajax/ajaxTest.js +++ b/src/ajax/ajaxTest.js @@ -70,8 +70,8 @@ test("load(String, Object, Function) - inject without callback", function() { test("load(String, Object, Function) - check scripts", function() { expect(7); stop(); - var testFoo = undefined; - foobar = null; + window.testFoo = undefined; + window.foobar = null; var verifyEvaluation = function() { ok( foobar == "bar", 'Check if script src was evaluated after load' ); ok( $('#ap').html() == 'bar', 'Check if script evaluation has modified DOM'); @@ -379,4 +379,17 @@ test("evalScripts() with no script elements", function() { ok ( true, 'after evalScripts()'); }); +test("custom timeout does not set error message when timeout occurs, see #970", function() { + stop(); + $.ajax({ + url: "data/name.php?wait=10", + timeout: 500, + error: function(request, status) { + ok( status != null, "status shouldn't be null in error handler" ); + equals( "timeout", status ); + start(); + } + }); +}); + }