From 8cbb4a0ae6c5f638922c77dcd63060c932fe6806 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=B6rn=20Zaefferer?= Date: Sun, 31 Dec 2006 15:44:59 +0000 Subject: [PATCH] Modified tests to show #746 --- build/test/data/test.php | 2 +- build/test/data/test2.php | 3 +++ src/ajax/ajaxTest.js | 13 ++++++++++++- 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 build/test/data/test2.php diff --git a/build/test/data/test.php b/build/test/data/test.php index fa36432..9dbea97 100644 --- a/build/test/data/test.php +++ b/build/test/data/test.php @@ -1,7 +1,7 @@ html text
blabla \ No newline at end of file diff --git a/build/test/data/test2.php b/build/test/data/test2.php new file mode 100644 index 0000000..95547fe --- /dev/null +++ b/build/test/data/test2.php @@ -0,0 +1,3 @@ + diff --git a/src/ajax/ajaxTest.js b/src/ajax/ajaxTest.js index 8d32716..6ca9cd7 100644 --- a/src/ajax/ajaxTest.js +++ b/src/ajax/ajaxTest.js @@ -72,17 +72,28 @@ test("load(String, Object, Function) - check scripts", function() { foobar = null; var verifyEvaluation = function() { ok( foobar == "bar", 'Check if script src was evaluated after load' ); - ok( $('#foo').html() == 'foo', 'Check if script evaluation has modified DOM'); ok( $('#ap').html() == 'bar', 'Check if script evaluation has modified DOM'); start(); }; $('#first').load(url('data/test.php'), function() { ok( $('#first').html().match(/^html text/), 'Check content after loading html' ); + ok( $('#foo').html() == 'foo', 'Check if script evaluation has modified DOM'); ok( testFoo == "foo", 'Check if script was evaluated after load' ); setTimeout(verifyEvaluation, 600); }); }); +test("load(String, Object, Function) - check file with only a script tag", function() { + expect(3); + stop(); + testFoo = undefined; + $('#first').load(url('data/test2.php'), function() { + ok( $('#foo').html() == 'foo', 'Check if script evaluation has modified DOM'); + ok( testFoo == "foo", 'Check if script was evaluated after load' ); + start(); + }); +}); + test("test global handlers - success", function() { expect(8); stop(); -- 1.7.10.4