headless-squirrel 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +55 -0
- data/Rakefile +27 -0
- data/bin/jstest +10 -0
- data/lib/headless_squirrel.rb +2 -0
- data/lib/headless_squirrel/console.rb +24 -0
- data/lib/headless_squirrel/runner.rb +70 -0
- data/lib/headless_squirrel/test.rb +17 -0
- data/lib/headless_squirrel/test_case.rb +158 -0
- data/test/fixtures/a_unit_test.html +27 -0
- data/test/fixtures/a_unit_test.js +22 -0
- data/test/fixtures/syntax_error.html +27 -0
- data/test/fixtures/syntax_error.js +5 -0
- data/test/fixtures/type_error.html +27 -0
- data/test/fixtures/type_error.js +1 -0
- data/test/regression/prototype/unit/ajax_test.html +29 -0
- data/test/regression/prototype/unit/array_test.html +28 -0
- data/test/regression/prototype/unit/assets/prototype.js +4900 -0
- data/test/regression/prototype/unit/assets/unittest.css +50 -0
- data/test/regression/prototype/unit/assets/unittest.js +615 -0
- data/test/regression/prototype/unit/assets/unittest_transport.js +1 -0
- data/test/regression/prototype/unit/base_test.html +27 -0
- data/test/regression/prototype/unit/class_test.html +27 -0
- data/test/regression/prototype/unit/date_test.html +27 -0
- data/test/regression/prototype/unit/dom_test.html +304 -0
- data/test/regression/prototype/unit/element_mixins_test.html +30 -0
- data/test/regression/prototype/unit/enumerable_test.html +35 -0
- data/test/regression/prototype/unit/event_test.html +31 -0
- data/test/regression/prototype/unit/fixtures/ajax.html +2 -0
- data/test/regression/prototype/unit/fixtures/ajax.js +42 -0
- data/test/regression/prototype/unit/fixtures/array.html +1 -0
- data/test/regression/prototype/unit/fixtures/class.js +83 -0
- data/test/regression/prototype/unit/fixtures/content.html +1 -0
- data/test/regression/prototype/unit/fixtures/data.json +1 -0
- data/test/regression/prototype/unit/fixtures/dom.css +84 -0
- data/test/regression/prototype/unit/fixtures/dom.html +278 -0
- data/test/regression/prototype/unit/fixtures/dom.js +17 -0
- data/test/regression/prototype/unit/fixtures/element_mixins.html +4 -0
- data/test/regression/prototype/unit/fixtures/element_mixins.js +2 -0
- data/test/regression/prototype/unit/fixtures/empty.html +0 -0
- data/test/regression/prototype/unit/fixtures/empty.js +1 -0
- data/test/regression/prototype/unit/fixtures/enumerable.html +8 -0
- data/test/regression/prototype/unit/fixtures/enumerable.js +23 -0
- data/test/regression/prototype/unit/fixtures/event.html +4 -0
- data/test/regression/prototype/unit/fixtures/form.html +108 -0
- data/test/regression/prototype/unit/fixtures/function.js +13 -0
- data/test/regression/prototype/unit/fixtures/hash.js +25 -0
- data/test/regression/prototype/unit/fixtures/hello.js +1 -0
- data/test/regression/prototype/unit/fixtures/logo.gif +0 -0
- data/test/regression/prototype/unit/fixtures/object.html +6 -0
- data/test/regression/prototype/unit/fixtures/object.js +7 -0
- data/test/regression/prototype/unit/fixtures/position.html +9 -0
- data/test/regression/prototype/unit/fixtures/selector.html +71 -0
- data/test/regression/prototype/unit/fixtures/string.js +8 -0
- data/test/regression/prototype/unit/fixtures/unittest.html +18 -0
- data/test/regression/prototype/unit/form_test.html +135 -0
- data/test/regression/prototype/unit/function_test.html +27 -0
- data/test/regression/prototype/unit/hash_test.html +27 -0
- data/test/regression/prototype/unit/number_test.html +27 -0
- data/test/regression/prototype/unit/object_test.html +32 -0
- data/test/regression/prototype/unit/periodical_executer_test.html +27 -0
- data/test/regression/prototype/unit/position_test.html +36 -0
- data/test/regression/prototype/unit/prototype_test.html +27 -0
- data/test/regression/prototype/unit/range_test.html +27 -0
- data/test/regression/prototype/unit/regexp_test.html +27 -0
- data/test/regression/prototype/unit/selector_test.html +98 -0
- data/test/regression/prototype/unit/string_test.html +27 -0
- data/test/regression/prototype/unit/tests/ajax_test.js +379 -0
- data/test/regression/prototype/unit/tests/array_test.js +186 -0
- data/test/regression/prototype/unit/tests/base_test.js +43 -0
- data/test/regression/prototype/unit/tests/class_test.js +136 -0
- data/test/regression/prototype/unit/tests/date_test.js +5 -0
- data/test/regression/prototype/unit/tests/dom_test.js +1493 -0
- data/test/regression/prototype/unit/tests/element_mixins_test.js +32 -0
- data/test/regression/prototype/unit/tests/enumerable_test.js +271 -0
- data/test/regression/prototype/unit/tests/event_test.js +235 -0
- data/test/regression/prototype/unit/tests/form_test.js +382 -0
- data/test/regression/prototype/unit/tests/function_test.js +133 -0
- data/test/regression/prototype/unit/tests/hash_test.js +178 -0
- data/test/regression/prototype/unit/tests/number_test.js +44 -0
- data/test/regression/prototype/unit/tests/object_test.js +180 -0
- data/test/regression/prototype/unit/tests/periodical_executer_test.js +15 -0
- data/test/regression/prototype/unit/tests/position_test.js +44 -0
- data/test/regression/prototype/unit/tests/prototype_test.js +43 -0
- data/test/regression/prototype/unit/tests/range_test.js +58 -0
- data/test/regression/prototype/unit/tests/regexp_test.js +42 -0
- data/test/regression/prototype/unit/tests/selector_test.js +408 -0
- data/test/regression/prototype/unit/tests/string_test.js +548 -0
- data/test/regression/prototype/unit/tests/unittest_test.js +148 -0
- data/test/regression/prototype/unit/unittest_test.html +45 -0
- data/test/regression/prototype/upstream +1 -0
- data/test/regression/scriptaculous/unit/_ajax_inplaceeditor_ipce_alt_text.html +1 -0
- data/test/regression/scriptaculous/unit/_ajax_inplaceeditor_ipce_collection.js +1 -0
- data/test/regression/scriptaculous/unit/_ajax_inplaceeditor_result.html +1 -0
- data/test/regression/scriptaculous/unit/_ajax_inplaceeditor_result2.html +1 -0
- data/test/regression/scriptaculous/unit/_ajax_inplaceeditor_tagged.html +1 -0
- data/test/regression/scriptaculous/unit/_ajax_inplaceeditor_text.html +1 -0
- data/test/regression/scriptaculous/unit/_ajax_updater_result.html +20 -0
- data/test/regression/scriptaculous/unit/_autocomplete_result.html +11 -0
- data/test/regression/scriptaculous/unit/_autocomplete_result_nobr.html +1 -0
- data/test/regression/scriptaculous/unit/ajax_autocompleter_test.html +243 -0
- data/test/regression/scriptaculous/unit/ajax_inplaceeditor_test.html +895 -0
- data/test/regression/scriptaculous/unit/assets/builder.js +134 -0
- data/test/regression/scriptaculous/unit/assets/controls.js +963 -0
- data/test/regression/scriptaculous/unit/assets/dragdrop.js +973 -0
- data/test/regression/scriptaculous/unit/assets/effects.js +1122 -0
- data/test/regression/scriptaculous/unit/assets/javascripttest.rb +203 -0
- data/test/regression/scriptaculous/unit/assets/prototype.js +4320 -0
- data/test/regression/scriptaculous/unit/assets/scriptaculous.js +66 -0
- data/test/regression/scriptaculous/unit/assets/slider.js +273 -0
- data/test/regression/scriptaculous/unit/assets/sound.js +57 -0
- data/test/regression/scriptaculous/unit/assets/unittest.js +566 -0
- data/test/regression/scriptaculous/unit/bdd_test.html +150 -0
- data/test/regression/scriptaculous/unit/builder_test.html +262 -0
- data/test/regression/scriptaculous/unit/dragdrop_test.html +131 -0
- data/test/regression/scriptaculous/unit/effects_test.html +547 -0
- data/test/regression/scriptaculous/unit/element_test.html +116 -0
- data/test/regression/scriptaculous/unit/icon.png +0 -0
- data/test/regression/scriptaculous/unit/index.html +70 -0
- data/test/regression/scriptaculous/unit/loading_test.html +41 -0
- data/test/regression/scriptaculous/unit/position_clone_test.html +312 -0
- data/test/regression/scriptaculous/unit/slider_test.html +437 -0
- data/test/regression/scriptaculous/unit/sortable_test.html +205 -0
- data/test/regression/scriptaculous/unit/string_test.html +71 -0
- data/test/regression/scriptaculous/unit/unittest_test.html +154 -0
- data/test/regression/scriptaculous/upstream +1 -0
- data/test/test_helper.rb +20 -0
- data/test/unit/runner_test.rb +165 -0
- data/test/unit/test_case_test.rb +207 -0
- data/test/unit/test_test.rb +24 -0
- metadata +209 -0
@@ -0,0 +1,27 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<title>Unit test file | Function | default template | 2009-04-11 15:28</title>
|
6
|
+
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
7
|
+
<script type="text/javascript" charset="utf-8">
|
8
|
+
var eventResults = {};
|
9
|
+
var originalElement = window.Element;
|
10
|
+
</script>
|
11
|
+
<script src="assets/prototype.js" type="text/javascript" charset="utf-8"></script>
|
12
|
+
<script src="assets/unittest.js" type="text/javascript" charset="utf-8"></script>
|
13
|
+
<link rel="stylesheet" href="assets/unittest.css" type="text/css" />
|
14
|
+
|
15
|
+
<script src="fixtures/function.js" type="text/javascript" charset="utf-8"></script>
|
16
|
+
<script src="tests/function_test.js" type="text/javascript" charset="utf-8"></script>
|
17
|
+
</head>
|
18
|
+
<body>
|
19
|
+
|
20
|
+
<div id="testlog"></div>
|
21
|
+
|
22
|
+
|
23
|
+
</body>
|
24
|
+
</html>
|
25
|
+
<script type="text/javascript" charset="utf-8">
|
26
|
+
eventResults.endOfDocument = true;
|
27
|
+
</script>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<title>Unit test file | Hash | default template | 2009-04-11 15:28</title>
|
6
|
+
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
7
|
+
<script type="text/javascript" charset="utf-8">
|
8
|
+
var eventResults = {};
|
9
|
+
var originalElement = window.Element;
|
10
|
+
</script>
|
11
|
+
<script src="assets/prototype.js" type="text/javascript" charset="utf-8"></script>
|
12
|
+
<script src="assets/unittest.js" type="text/javascript" charset="utf-8"></script>
|
13
|
+
<link rel="stylesheet" href="assets/unittest.css" type="text/css" />
|
14
|
+
|
15
|
+
<script src="fixtures/hash.js" type="text/javascript" charset="utf-8"></script>
|
16
|
+
<script src="tests/hash_test.js" type="text/javascript" charset="utf-8"></script>
|
17
|
+
</head>
|
18
|
+
<body>
|
19
|
+
|
20
|
+
<div id="testlog"></div>
|
21
|
+
|
22
|
+
|
23
|
+
</body>
|
24
|
+
</html>
|
25
|
+
<script type="text/javascript" charset="utf-8">
|
26
|
+
eventResults.endOfDocument = true;
|
27
|
+
</script>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<title>Unit test file | Number | default template | 2009-04-11 15:28</title>
|
6
|
+
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
7
|
+
<script type="text/javascript" charset="utf-8">
|
8
|
+
var eventResults = {};
|
9
|
+
var originalElement = window.Element;
|
10
|
+
</script>
|
11
|
+
<script src="assets/prototype.js" type="text/javascript" charset="utf-8"></script>
|
12
|
+
<script src="assets/unittest.js" type="text/javascript" charset="utf-8"></script>
|
13
|
+
<link rel="stylesheet" href="assets/unittest.css" type="text/css" />
|
14
|
+
|
15
|
+
|
16
|
+
<script src="tests/number_test.js" type="text/javascript" charset="utf-8"></script>
|
17
|
+
</head>
|
18
|
+
<body>
|
19
|
+
|
20
|
+
<div id="testlog"></div>
|
21
|
+
|
22
|
+
|
23
|
+
</body>
|
24
|
+
</html>
|
25
|
+
<script type="text/javascript" charset="utf-8">
|
26
|
+
eventResults.endOfDocument = true;
|
27
|
+
</script>
|
@@ -0,0 +1,32 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<title>Unit test file | Object | default template | 2009-04-11 15:28</title>
|
6
|
+
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
7
|
+
<script type="text/javascript" charset="utf-8">
|
8
|
+
var eventResults = {};
|
9
|
+
var originalElement = window.Element;
|
10
|
+
</script>
|
11
|
+
<script src="assets/prototype.js" type="text/javascript" charset="utf-8"></script>
|
12
|
+
<script src="assets/unittest.js" type="text/javascript" charset="utf-8"></script>
|
13
|
+
<link rel="stylesheet" href="assets/unittest.css" type="text/css" />
|
14
|
+
|
15
|
+
<script src="fixtures/object.js" type="text/javascript" charset="utf-8"></script>
|
16
|
+
<script src="tests/object_test.js" type="text/javascript" charset="utf-8"></script>
|
17
|
+
</head>
|
18
|
+
<body>
|
19
|
+
|
20
|
+
<div id="testlog"></div>
|
21
|
+
|
22
|
+
<div id="test"></div>
|
23
|
+
<ul id="list">
|
24
|
+
<li></li>
|
25
|
+
<li></li>
|
26
|
+
<li></li>
|
27
|
+
</ul>
|
28
|
+
</body>
|
29
|
+
</html>
|
30
|
+
<script type="text/javascript" charset="utf-8">
|
31
|
+
eventResults.endOfDocument = true;
|
32
|
+
</script>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<title>Unit test file | Periodical Executer | default template | 2009-04-11 15:28</title>
|
6
|
+
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
7
|
+
<script type="text/javascript" charset="utf-8">
|
8
|
+
var eventResults = {};
|
9
|
+
var originalElement = window.Element;
|
10
|
+
</script>
|
11
|
+
<script src="assets/prototype.js" type="text/javascript" charset="utf-8"></script>
|
12
|
+
<script src="assets/unittest.js" type="text/javascript" charset="utf-8"></script>
|
13
|
+
<link rel="stylesheet" href="assets/unittest.css" type="text/css" />
|
14
|
+
|
15
|
+
|
16
|
+
<script src="tests/periodical_executer_test.js" type="text/javascript" charset="utf-8"></script>
|
17
|
+
</head>
|
18
|
+
<body>
|
19
|
+
|
20
|
+
<div id="testlog"></div>
|
21
|
+
|
22
|
+
|
23
|
+
</body>
|
24
|
+
</html>
|
25
|
+
<script type="text/javascript" charset="utf-8">
|
26
|
+
eventResults.endOfDocument = true;
|
27
|
+
</script>
|
@@ -0,0 +1,36 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<title>Unit test file | Position | default template | 2009-04-11 15:28</title>
|
6
|
+
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
7
|
+
<script type="text/javascript" charset="utf-8">
|
8
|
+
var eventResults = {};
|
9
|
+
var originalElement = window.Element;
|
10
|
+
</script>
|
11
|
+
<script src="assets/prototype.js" type="text/javascript" charset="utf-8"></script>
|
12
|
+
<script src="assets/unittest.js" type="text/javascript" charset="utf-8"></script>
|
13
|
+
<link rel="stylesheet" href="assets/unittest.css" type="text/css" />
|
14
|
+
|
15
|
+
|
16
|
+
<script src="tests/position_test.js" type="text/javascript" charset="utf-8"></script>
|
17
|
+
</head>
|
18
|
+
<body>
|
19
|
+
|
20
|
+
<div id="testlog"></div>
|
21
|
+
|
22
|
+
<div id="ensure_scrollbars" style="width:10000px; height:10000px; position:absolute" > </div>
|
23
|
+
|
24
|
+
<div id="body_absolute" style="position: absolute; top: 10px; left: 10px">
|
25
|
+
<div id="absolute_absolute" style="position: absolute; top: 10px; left:10px"> </div>
|
26
|
+
<div id="absolute_relative" style="position: relative; top: 10px; left:10px">
|
27
|
+
<div style="height:10px;font-size:2px">test<span id="inline">test</span></div>
|
28
|
+
<div id="absolute_relative_undefined"> </div>
|
29
|
+
</div>
|
30
|
+
</div>
|
31
|
+
|
32
|
+
</body>
|
33
|
+
</html>
|
34
|
+
<script type="text/javascript" charset="utf-8">
|
35
|
+
eventResults.endOfDocument = true;
|
36
|
+
</script>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<title>Unit test file | Prototype | default template | 2009-04-11 15:28</title>
|
6
|
+
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
7
|
+
<script type="text/javascript" charset="utf-8">
|
8
|
+
var eventResults = {};
|
9
|
+
var originalElement = window.Element;
|
10
|
+
</script>
|
11
|
+
<script src="assets/prototype.js" type="text/javascript" charset="utf-8"></script>
|
12
|
+
<script src="assets/unittest.js" type="text/javascript" charset="utf-8"></script>
|
13
|
+
<link rel="stylesheet" href="assets/unittest.css" type="text/css" />
|
14
|
+
|
15
|
+
|
16
|
+
<script src="tests/prototype_test.js" type="text/javascript" charset="utf-8"></script>
|
17
|
+
</head>
|
18
|
+
<body>
|
19
|
+
|
20
|
+
<div id="testlog"></div>
|
21
|
+
|
22
|
+
|
23
|
+
</body>
|
24
|
+
</html>
|
25
|
+
<script type="text/javascript" charset="utf-8">
|
26
|
+
eventResults.endOfDocument = true;
|
27
|
+
</script>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<title>Unit test file | Range | default template | 2009-04-11 15:28</title>
|
6
|
+
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
7
|
+
<script type="text/javascript" charset="utf-8">
|
8
|
+
var eventResults = {};
|
9
|
+
var originalElement = window.Element;
|
10
|
+
</script>
|
11
|
+
<script src="assets/prototype.js" type="text/javascript" charset="utf-8"></script>
|
12
|
+
<script src="assets/unittest.js" type="text/javascript" charset="utf-8"></script>
|
13
|
+
<link rel="stylesheet" href="assets/unittest.css" type="text/css" />
|
14
|
+
|
15
|
+
|
16
|
+
<script src="tests/range_test.js" type="text/javascript" charset="utf-8"></script>
|
17
|
+
</head>
|
18
|
+
<body>
|
19
|
+
|
20
|
+
<div id="testlog"></div>
|
21
|
+
|
22
|
+
|
23
|
+
</body>
|
24
|
+
</html>
|
25
|
+
<script type="text/javascript" charset="utf-8">
|
26
|
+
eventResults.endOfDocument = true;
|
27
|
+
</script>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<title>Unit test file | Regexp | default template | 2009-04-11 15:28</title>
|
6
|
+
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
7
|
+
<script type="text/javascript" charset="utf-8">
|
8
|
+
var eventResults = {};
|
9
|
+
var originalElement = window.Element;
|
10
|
+
</script>
|
11
|
+
<script src="assets/prototype.js" type="text/javascript" charset="utf-8"></script>
|
12
|
+
<script src="assets/unittest.js" type="text/javascript" charset="utf-8"></script>
|
13
|
+
<link rel="stylesheet" href="assets/unittest.css" type="text/css" />
|
14
|
+
|
15
|
+
|
16
|
+
<script src="tests/regexp_test.js" type="text/javascript" charset="utf-8"></script>
|
17
|
+
</head>
|
18
|
+
<body>
|
19
|
+
|
20
|
+
<div id="testlog"></div>
|
21
|
+
|
22
|
+
|
23
|
+
</body>
|
24
|
+
</html>
|
25
|
+
<script type="text/javascript" charset="utf-8">
|
26
|
+
eventResults.endOfDocument = true;
|
27
|
+
</script>
|
@@ -0,0 +1,98 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<title>Unit test file | Selector | default template | 2009-04-11 15:28</title>
|
6
|
+
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
7
|
+
<script type="text/javascript" charset="utf-8">
|
8
|
+
var eventResults = {};
|
9
|
+
var originalElement = window.Element;
|
10
|
+
</script>
|
11
|
+
<script src="assets/prototype.js" type="text/javascript" charset="utf-8"></script>
|
12
|
+
<script src="assets/unittest.js" type="text/javascript" charset="utf-8"></script>
|
13
|
+
<link rel="stylesheet" href="assets/unittest.css" type="text/css" />
|
14
|
+
|
15
|
+
|
16
|
+
<script src="tests/selector_test.js" type="text/javascript" charset="utf-8"></script>
|
17
|
+
</head>
|
18
|
+
<body>
|
19
|
+
|
20
|
+
<div id="testlog"></div>
|
21
|
+
|
22
|
+
<div id="fixtures" style="display: none">
|
23
|
+
<h1 class="title">Some title <span>here</span></h1>
|
24
|
+
<p id="p" class="first summary">
|
25
|
+
<strong id="strong">This</strong> is a short blurb
|
26
|
+
<a id="link_1" class="first internal" rel="external nofollow" href="#">with a <em id="em2">link</em></a> or
|
27
|
+
<a id="link_2" class="internal highlight" href="#"><em id="em">two</em></a>.
|
28
|
+
Or <cite id="with_title" title="hello world!">a citation</cite>.
|
29
|
+
</p>
|
30
|
+
<ul id="list">
|
31
|
+
<li id="item_1" class="first"><a id="link_3" href="#" class="external"><span id="span">Another link</span></a></li>
|
32
|
+
<li id="item_2">Some text</li>
|
33
|
+
<li id="item_3" xml:lang="es-us" class="">Otra cosa</li>
|
34
|
+
</ul>
|
35
|
+
|
36
|
+
<!-- this form has a field with the name 'id',
|
37
|
+
therefore its ID property won't be 'troubleForm': -->
|
38
|
+
<form id="troubleForm">
|
39
|
+
<input type="hidden" name="id" id="hidden" />
|
40
|
+
<input type="text" name="disabled_text_field" id="disabled_text_field" disabled="disabled" />
|
41
|
+
<input type="text" name="enabled_text_field" id="enabled_text_field" />
|
42
|
+
<input type="checkbox" name="checkboxes" id="checked_box" checked="checked" value="Checked" />
|
43
|
+
<input type="checkbox" name="checkboxes" id="unchecked_box" value="Unchecked"/>
|
44
|
+
<input type="radio" name="radiobuttons" id="checked_radio" checked="checked" value="Checked" />
|
45
|
+
<input type="radio" name="radiobuttons" id="unchecked_radio" value="Unchecked" />
|
46
|
+
</form>
|
47
|
+
|
48
|
+
<form id="troubleForm2">
|
49
|
+
<input type="checkbox" name="brackets[5][]" id="chk_1" checked="checked" value="1" />
|
50
|
+
<input type="checkbox" name="brackets[5][]" id="chk_2" value="2" />
|
51
|
+
</form>
|
52
|
+
|
53
|
+
<div id="level1">
|
54
|
+
<span id="level2_1">
|
55
|
+
<span id="level3_1"></span>
|
56
|
+
<!-- This comment should be ignored by the adjacent selector -->
|
57
|
+
<span id="level3_2"></span>
|
58
|
+
</span>
|
59
|
+
<span id="level2_2">
|
60
|
+
<em id="level_only_child">
|
61
|
+
</em>
|
62
|
+
</span>
|
63
|
+
<div id="level2_3"></div>
|
64
|
+
</div> <!-- #level1 -->
|
65
|
+
|
66
|
+
<div id="dupContainer">
|
67
|
+
<span id="dupL1" class="span_foo span_bar">
|
68
|
+
<span id="dupL2">
|
69
|
+
<span id="dupL3">
|
70
|
+
<span id="dupL4">
|
71
|
+
<span id="dupL5"></span>
|
72
|
+
</span>
|
73
|
+
</span>
|
74
|
+
</span>
|
75
|
+
</span>
|
76
|
+
</div> <!-- #dupContainer -->
|
77
|
+
|
78
|
+
<div id="grandfather"> grandfather
|
79
|
+
<div id="father" class="brothers men"> father
|
80
|
+
<div id="son"> son </div>
|
81
|
+
</div>
|
82
|
+
<div id="uncle" class="brothers men"> uncle </div>
|
83
|
+
</div>
|
84
|
+
|
85
|
+
<form id="commaParent" title="commas,are,good">
|
86
|
+
<input type="hidden" id="commaChild" name="foo" value="#commaOne,#commaTwo" />
|
87
|
+
<input type="hidden" id="commaTwo" name="foo2" value="oops" />
|
88
|
+
</form>
|
89
|
+
<div id="counted_container"><div class="is_counted"></div></div>
|
90
|
+
|
91
|
+
<div foo-bar="baz" id="attr_with_dash">blah</div>
|
92
|
+
</div>
|
93
|
+
|
94
|
+
</body>
|
95
|
+
</html>
|
96
|
+
<script type="text/javascript" charset="utf-8">
|
97
|
+
eventResults.endOfDocument = true;
|
98
|
+
</script>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<title>Unit test file | String | default template | 2009-04-11 15:28</title>
|
6
|
+
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
7
|
+
<script type="text/javascript" charset="utf-8">
|
8
|
+
var eventResults = {};
|
9
|
+
var originalElement = window.Element;
|
10
|
+
</script>
|
11
|
+
<script src="assets/prototype.js" type="text/javascript" charset="utf-8"></script>
|
12
|
+
<script src="assets/unittest.js" type="text/javascript" charset="utf-8"></script>
|
13
|
+
<link rel="stylesheet" href="assets/unittest.css" type="text/css" />
|
14
|
+
|
15
|
+
<script src="fixtures/string.js" type="text/javascript" charset="utf-8"></script>
|
16
|
+
<script src="tests/string_test.js" type="text/javascript" charset="utf-8"></script>
|
17
|
+
</head>
|
18
|
+
<body>
|
19
|
+
|
20
|
+
<div id="testlog"></div>
|
21
|
+
|
22
|
+
|
23
|
+
</body>
|
24
|
+
</html>
|
25
|
+
<script type="text/javascript" charset="utf-8">
|
26
|
+
eventResults.endOfDocument = true;
|
27
|
+
</script>
|
@@ -0,0 +1,379 @@
|
|
1
|
+
var extendDefault = function(options) {
|
2
|
+
return Object.extend({
|
3
|
+
asynchronous: false,
|
4
|
+
method: 'get',
|
5
|
+
onException: function(e) { throw e }
|
6
|
+
}, options);
|
7
|
+
};
|
8
|
+
|
9
|
+
new Test.Unit.Runner({
|
10
|
+
setup: function() {
|
11
|
+
$('content').update('');
|
12
|
+
$('content2').update('');
|
13
|
+
},
|
14
|
+
|
15
|
+
teardown: function() {
|
16
|
+
// hack to cleanup responders
|
17
|
+
Ajax.Responders.responders = [Ajax.Responders.responders[0]];
|
18
|
+
},
|
19
|
+
|
20
|
+
testSynchronousRequest: function() {
|
21
|
+
this.assertEqual("", $("content").innerHTML);
|
22
|
+
|
23
|
+
this.assertEqual(0, Ajax.activeRequestCount);
|
24
|
+
new Ajax.Request("fixtures/hello.js", {
|
25
|
+
asynchronous: false,
|
26
|
+
method: 'GET',
|
27
|
+
evalJS: 'force'
|
28
|
+
});
|
29
|
+
this.assertEqual(0, Ajax.activeRequestCount);
|
30
|
+
|
31
|
+
var h2 = $("content").firstChild;
|
32
|
+
this.assertEqual("Hello world!", h2.innerHTML);
|
33
|
+
},
|
34
|
+
|
35
|
+
testAsynchronousRequest: function() {
|
36
|
+
this.assertEqual("", $("content").innerHTML);
|
37
|
+
|
38
|
+
new Ajax.Request("fixtures/hello.js", {
|
39
|
+
asynchronous: true,
|
40
|
+
method: 'get',
|
41
|
+
evalJS: 'force'
|
42
|
+
});
|
43
|
+
this.wait(1000, function() {
|
44
|
+
var h2 = $("content").firstChild;
|
45
|
+
this.assertEqual("Hello world!", h2.innerHTML);
|
46
|
+
});
|
47
|
+
},
|
48
|
+
|
49
|
+
testUpdater: function() {
|
50
|
+
this.assertEqual("", $("content").innerHTML);
|
51
|
+
|
52
|
+
new Ajax.Updater("content", "fixtures/content.html", { method:'get' });
|
53
|
+
|
54
|
+
this.wait(1000, function() {
|
55
|
+
this.assertEqual(sentence, $("content").innerHTML.strip().toLowerCase());
|
56
|
+
|
57
|
+
$('content').update('');
|
58
|
+
this.assertEqual("", $("content").innerHTML);
|
59
|
+
|
60
|
+
new Ajax.Updater({ success:"content", failure:"content2" },
|
61
|
+
"fixtures/content.html", { method:'get', parameters:{ pet:'monkey' } });
|
62
|
+
|
63
|
+
new Ajax.Updater("", "fixtures/content.html", { method:'get', parameters:"pet=monkey" });
|
64
|
+
|
65
|
+
this.wait(1000, function() {
|
66
|
+
this.assertEqual(sentence, $("content").innerHTML.strip().toLowerCase());
|
67
|
+
this.assertEqual("", $("content2").innerHTML);
|
68
|
+
});
|
69
|
+
});
|
70
|
+
},
|
71
|
+
|
72
|
+
testUpdaterWithInsertion: function() {
|
73
|
+
$('content').update();
|
74
|
+
new Ajax.Updater("content", "fixtures/content.html", { method:'get', insertion: Insertion.Top });
|
75
|
+
this.wait(1000, function() {
|
76
|
+
this.assertEqual(sentence, $("content").innerHTML.strip().toLowerCase());
|
77
|
+
$('content').update();
|
78
|
+
new Ajax.Updater("content", "fixtures/content.html", { method:'get', insertion: 'bottom' });
|
79
|
+
this.wait(1000, function() {
|
80
|
+
this.assertEqual(sentence, $("content").innerHTML.strip().toLowerCase());
|
81
|
+
|
82
|
+
$('content').update();
|
83
|
+
new Ajax.Updater("content", "fixtures/content.html", { method:'get', insertion: 'after' });
|
84
|
+
this.wait(1000, function() {
|
85
|
+
this.assertEqual('five dozen', $("content").next().innerHTML.strip().toLowerCase());
|
86
|
+
});
|
87
|
+
});
|
88
|
+
});
|
89
|
+
},
|
90
|
+
|
91
|
+
testUpdaterOptions: function() {
|
92
|
+
var options = {
|
93
|
+
method: 'get',
|
94
|
+
asynchronous: false,
|
95
|
+
evalJS: 'force',
|
96
|
+
onComplete: Prototype.emptyFunction
|
97
|
+
}
|
98
|
+
var request = new Ajax.Updater("content", "../fixtures/hello.js", options);
|
99
|
+
request.options.onComplete = Prototype.emptyFunction;
|
100
|
+
this.assertIdentical(Prototype.emptyFunction, options.onComplete);
|
101
|
+
},
|
102
|
+
|
103
|
+
testResponders: function(){
|
104
|
+
// check for internal responder
|
105
|
+
this.assertEqual(1, Ajax.Responders.responders.length);
|
106
|
+
|
107
|
+
var dummyResponder = {
|
108
|
+
onComplete: Prototype.emptyFunction
|
109
|
+
};
|
110
|
+
|
111
|
+
Ajax.Responders.register(dummyResponder);
|
112
|
+
this.assertEqual(2, Ajax.Responders.responders.length);
|
113
|
+
|
114
|
+
// don't add twice
|
115
|
+
Ajax.Responders.register(dummyResponder);
|
116
|
+
this.assertEqual(2, Ajax.Responders.responders.length);
|
117
|
+
|
118
|
+
Ajax.Responders.unregister(dummyResponder);
|
119
|
+
this.assertEqual(1, Ajax.Responders.responders.length);
|
120
|
+
|
121
|
+
var responder = {
|
122
|
+
onCreate: function(req){ responderCounter++ },
|
123
|
+
onLoading: function(req){ responderCounter++ },
|
124
|
+
onComplete: function(req){ responderCounter++ }
|
125
|
+
};
|
126
|
+
Ajax.Responders.register(responder);
|
127
|
+
|
128
|
+
this.assertEqual(0, responderCounter);
|
129
|
+
this.assertEqual(0, Ajax.activeRequestCount);
|
130
|
+
new Ajax.Request("../fixtures/content.html", { method:'get', parameters:"pet=monkey" });
|
131
|
+
this.assertEqual(1, responderCounter);
|
132
|
+
this.assertEqual(1, Ajax.activeRequestCount);
|
133
|
+
|
134
|
+
this.wait(1000,function() {
|
135
|
+
this.assertEqual(3, responderCounter);
|
136
|
+
this.assertEqual(0, Ajax.activeRequestCount);
|
137
|
+
});
|
138
|
+
},
|
139
|
+
|
140
|
+
testEvalResponseShouldBeCalledBeforeOnComplete: function() {
|
141
|
+
if (this.isRunningFromRake) {
|
142
|
+
this.assertEqual("", $("content").innerHTML);
|
143
|
+
|
144
|
+
this.assertEqual(0, Ajax.activeRequestCount);
|
145
|
+
new Ajax.Request("../fixtures/hello.js", extendDefault({
|
146
|
+
onComplete: function(response) { this.assertNotEqual("", $("content").innerHTML) }.bind(this)
|
147
|
+
}));
|
148
|
+
this.assertEqual(0, Ajax.activeRequestCount);
|
149
|
+
|
150
|
+
var h2 = $("content").firstChild;
|
151
|
+
this.assertEqual("Hello world!", h2.innerHTML);
|
152
|
+
} else {
|
153
|
+
this.info(message);
|
154
|
+
}
|
155
|
+
},
|
156
|
+
|
157
|
+
testContentTypeSetForSimulatedVerbs: function() {
|
158
|
+
if (this.isRunningFromRake) {
|
159
|
+
new Ajax.Request('/inspect', extendDefault({
|
160
|
+
method: 'put',
|
161
|
+
contentType: 'application/bogus',
|
162
|
+
onComplete: function(response) {
|
163
|
+
this.assertEqual('application/bogus; charset=UTF-8', response.responseJSON.headers['content-type']);
|
164
|
+
}.bind(this)
|
165
|
+
}));
|
166
|
+
} else {
|
167
|
+
this.info(message);
|
168
|
+
}
|
169
|
+
},
|
170
|
+
|
171
|
+
testOnCreateCallback: function() {
|
172
|
+
new Ajax.Request("../fixtures/content.html", extendDefault({
|
173
|
+
onCreate: function(transport) { this.assertEqual(0, transport.readyState) }.bind(this),
|
174
|
+
onComplete: function(transport) { this.assertNotEqual(0, transport.readyState) }.bind(this)
|
175
|
+
}));
|
176
|
+
},
|
177
|
+
|
178
|
+
testEvalJS: function() {
|
179
|
+
if (this.isRunningFromRake) {
|
180
|
+
|
181
|
+
$('content').update();
|
182
|
+
new Ajax.Request("/response", extendDefault({
|
183
|
+
parameters: Fixtures.js,
|
184
|
+
onComplete: function(transport) {
|
185
|
+
var h2 = $("content").firstChild;
|
186
|
+
this.assertEqual("Hello world!", h2.innerHTML);
|
187
|
+
}.bind(this)
|
188
|
+
}));
|
189
|
+
|
190
|
+
$('content').update();
|
191
|
+
new Ajax.Request("/response", extendDefault({
|
192
|
+
evalJS: false,
|
193
|
+
parameters: Fixtures.js,
|
194
|
+
onComplete: function(transport) {
|
195
|
+
this.assertEqual("", $("content").innerHTML);
|
196
|
+
}.bind(this)
|
197
|
+
}));
|
198
|
+
} else {
|
199
|
+
this.info(message);
|
200
|
+
}
|
201
|
+
|
202
|
+
$('content').update();
|
203
|
+
new Ajax.Request("../fixtures/hello.js", extendDefault({
|
204
|
+
evalJS: 'force',
|
205
|
+
onComplete: function(transport) {
|
206
|
+
var h2 = $("content").firstChild;
|
207
|
+
this.assertEqual("Hello world!", h2.innerHTML);
|
208
|
+
}.bind(this)
|
209
|
+
}));
|
210
|
+
},
|
211
|
+
|
212
|
+
testCallbacks: function() {
|
213
|
+
var options = extendDefault({
|
214
|
+
onCreate: function(transport) { this.assertInstanceOf(Ajax.Response, transport) }.bind(this)
|
215
|
+
});
|
216
|
+
|
217
|
+
Ajax.Request.Events.each(function(state){
|
218
|
+
options['on' + state] = options.onCreate;
|
219
|
+
});
|
220
|
+
|
221
|
+
new Ajax.Request("../fixtures/content.html", options);
|
222
|
+
},
|
223
|
+
|
224
|
+
testResponseText: function() {
|
225
|
+
new Ajax.Request("fixtures/empty.html", extendDefault({
|
226
|
+
onComplete: function(transport) { this.assertEqual('', transport.responseText) }.bind(this)
|
227
|
+
}));
|
228
|
+
|
229
|
+
new Ajax.Request("fixtures/content.html", extendDefault({
|
230
|
+
onComplete: function(transport) { this.assertEqual(sentence, transport.responseText.toLowerCase()) }.bind(this)
|
231
|
+
}));
|
232
|
+
},
|
233
|
+
|
234
|
+
testResponseXML: function() {
|
235
|
+
if (this.isRunningFromRake) {
|
236
|
+
new Ajax.Request("/response", extendDefault({
|
237
|
+
parameters: Fixtures.xml,
|
238
|
+
onComplete: function(transport) {
|
239
|
+
this.assertEqual('foo', transport.responseXML.getElementsByTagName('name')[0].getAttribute('attr'))
|
240
|
+
}.bind(this)
|
241
|
+
}));
|
242
|
+
} else {
|
243
|
+
this.info(message);
|
244
|
+
}
|
245
|
+
},
|
246
|
+
|
247
|
+
testResponseJSON: function() {
|
248
|
+
if (this.isRunningFromRake) {
|
249
|
+
new Ajax.Request("/response", extendDefault({
|
250
|
+
parameters: Fixtures.json,
|
251
|
+
onComplete: function(transport) { this.assertEqual(123, transport.responseJSON.test) }.bind(this)
|
252
|
+
}));
|
253
|
+
|
254
|
+
new Ajax.Request("/response", extendDefault({
|
255
|
+
parameters: {
|
256
|
+
'Content-Length': 0,
|
257
|
+
'Content-Type': 'application/json'
|
258
|
+
},
|
259
|
+
onComplete: function(transport) { this.assertNull(transport.responseJSON) }.bind(this)
|
260
|
+
}));
|
261
|
+
|
262
|
+
new Ajax.Request("/response", extendDefault({
|
263
|
+
evalJSON: false,
|
264
|
+
parameters: Fixtures.json,
|
265
|
+
onComplete: function(transport) { this.assertNull(transport.responseJSON) }.bind(this)
|
266
|
+
}));
|
267
|
+
|
268
|
+
new Ajax.Request("/response", extendDefault({
|
269
|
+
parameters: Fixtures.jsonWithoutContentType,
|
270
|
+
onComplete: function(transport) { this.assertNull(transport.responseJSON) }.bind(this)
|
271
|
+
}));
|
272
|
+
|
273
|
+
new Ajax.Request("/response", extendDefault({
|
274
|
+
sanitizeJSON: true,
|
275
|
+
parameters: Fixtures.invalidJson,
|
276
|
+
onException: function(request, error) {
|
277
|
+
this.assert(error.message.include('Badly formed JSON string'));
|
278
|
+
this.assertInstanceOf(Ajax.Request, request);
|
279
|
+
}.bind(this)
|
280
|
+
}));
|
281
|
+
} else {
|
282
|
+
this.info(message);
|
283
|
+
}
|
284
|
+
|
285
|
+
new Ajax.Request("../fixtures/data.json", extendDefault({
|
286
|
+
evalJSON: 'force',
|
287
|
+
onComplete: function(transport) { this.assertEqual(123, transport.responseJSON.test) }.bind(this)
|
288
|
+
}));
|
289
|
+
},
|
290
|
+
|
291
|
+
testHeaderJSON: function() {
|
292
|
+
if (this.isRunningFromRake) {
|
293
|
+
new Ajax.Request("/response", extendDefault({
|
294
|
+
parameters: Fixtures.headerJson,
|
295
|
+
onComplete: function(transport, json) {
|
296
|
+
this.assertEqual('hello #éà', transport.headerJSON.test);
|
297
|
+
this.assertEqual('hello #éà', json.test);
|
298
|
+
}.bind(this)
|
299
|
+
}));
|
300
|
+
|
301
|
+
new Ajax.Request("/response", extendDefault({
|
302
|
+
onComplete: function(transport, json) {
|
303
|
+
this.assertNull(transport.headerJSON)
|
304
|
+
this.assertNull(json)
|
305
|
+
}.bind(this)
|
306
|
+
}));
|
307
|
+
} else {
|
308
|
+
this.info(message);
|
309
|
+
}
|
310
|
+
},
|
311
|
+
|
312
|
+
testGetHeader: function() {
|
313
|
+
if (this.isRunningFromRake) {
|
314
|
+
new Ajax.Request("/response", extendDefault({
|
315
|
+
parameters: { 'X-TEST': 'some value' },
|
316
|
+
onComplete: function(transport) {
|
317
|
+
this.assertEqual('some value', transport.getHeader('X-Test'));
|
318
|
+
this.assertNull(transport.getHeader('X-Inexistant'));
|
319
|
+
}.bind(this)
|
320
|
+
}));
|
321
|
+
} else {
|
322
|
+
this.info(message);
|
323
|
+
}
|
324
|
+
},
|
325
|
+
|
326
|
+
testParametersCanBeHash: function() {
|
327
|
+
if (this.isRunningFromRake) {
|
328
|
+
new Ajax.Request("/response", extendDefault({
|
329
|
+
parameters: $H({ "one": "two", "three": "four" }),
|
330
|
+
onComplete: function(transport) {
|
331
|
+
this.assertEqual("two", transport.getHeader("one"));
|
332
|
+
this.assertEqual("four", transport.getHeader("three"));
|
333
|
+
this.assertNull(transport.getHeader("toObject"));
|
334
|
+
}.bind(this)
|
335
|
+
}));
|
336
|
+
} else {
|
337
|
+
this.info(message);
|
338
|
+
}
|
339
|
+
},
|
340
|
+
|
341
|
+
testIsSameOriginMethod: function() {
|
342
|
+
var isSameOrigin = Ajax.Request.prototype.isSameOrigin;
|
343
|
+
this.assert(isSameOrigin.call({ url: '/foo/bar.html' }), '/foo/bar.html');
|
344
|
+
this.assert(isSameOrigin.call({ url: window.location.toString() }), window.location);
|
345
|
+
this.assert(!isSameOrigin.call({ url: 'http://example.com' }), 'http://example.com');
|
346
|
+
|
347
|
+
if (this.isRunningFromRake) {
|
348
|
+
Ajax.Request.prototype.isSameOrigin = function() {
|
349
|
+
return false
|
350
|
+
};
|
351
|
+
|
352
|
+
$("content").update('same origin policy');
|
353
|
+
new Ajax.Request("/response", extendDefault({
|
354
|
+
parameters: Fixtures.js,
|
355
|
+
onComplete: function(transport) {
|
356
|
+
this.assertEqual("same origin policy", $("content").innerHTML);
|
357
|
+
}.bind(this)
|
358
|
+
}));
|
359
|
+
|
360
|
+
new Ajax.Request("/response", extendDefault({
|
361
|
+
parameters: Fixtures.invalidJson,
|
362
|
+
onException: function(request, error) {
|
363
|
+
this.assert(error.message.include('Badly formed JSON string'));
|
364
|
+
}.bind(this)
|
365
|
+
}));
|
366
|
+
|
367
|
+
new Ajax.Request("/response", extendDefault({
|
368
|
+
parameters: { 'X-JSON': '{});window.attacked = true;({}' },
|
369
|
+
onException: function(request, error) {
|
370
|
+
this.assert(error.message.include('Badly formed JSON string'));
|
371
|
+
}.bind(this)
|
372
|
+
}));
|
373
|
+
|
374
|
+
Ajax.Request.prototype.isSameOrigin = isSameOrigin;
|
375
|
+
} else {
|
376
|
+
this.info(message);
|
377
|
+
}
|
378
|
+
}
|
379
|
+
});
|