aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2006-12-31 15:44:59 +0000
committerJörn Zaefferer <joern.zaefferer@gmail.com>2006-12-31 15:44:59 +0000
commit8cbb4a0ae6c5f638922c77dcd63060c932fe6806 (patch)
tree4c53d99b8ab23fa8abf4695a0b9a636ee656b78b
parent4c66f62a6fcc84a6c85249d0fb34b93edd40be00 (diff)
downloadjquery-8cbb4a0ae6c5f638922c77dcd63060c932fe6806.tar.gz
jquery-8cbb4a0ae6c5f638922c77dcd63060c932fe6806.zip
Modified tests to show #746
-rw-r--r--build/test/data/test.php2
-rw-r--r--build/test/data/test2.php3
-rw-r--r--src/ajax/ajaxTest.js13
3 files changed, 16 insertions, 2 deletions
diff --git a/build/test/data/test.php b/build/test/data/test.php
index fa36432f8..9dbea9798 100644
--- a/build/test/data/test.php
+++ b/build/test/data/test.php
@@ -1,7 +1,7 @@
html text<br/>
<script type="text/javascript">/* <![CDATA[ */
testFoo = "foo"; $('#foo').html('foo');
-ok( true, "test.html executed" );
+ok( true, "test.php executed" );
/* ]]> */</script>
<script src="data/test.js?<?php srand(); echo time() . '' . rand(); ?>"></script>
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 000000000..95547fecd
--- /dev/null
+++ b/build/test/data/test2.php
@@ -0,0 +1,3 @@
+<script type="text/javascript">
+testFoo = "foo"; $('#foo').html('foo');ok( true, "test2.php executed" );
+</script>
diff --git a/src/ajax/ajaxTest.js b/src/ajax/ajaxTest.js
index 8d32716fa..6ca9cd7c6 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();