forked from rails/javascript_test
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JavaScript test plugin: Issue headers that prevent caching, #6218, ad…
…ded test for JavaScript test runner
- Loading branch information
Showing
4 changed files
with
94 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
require 'test/unit' | ||
require 'lib/javascript_test.rb' | ||
|
||
# mock RAILS_ROOT required because of file existance check | ||
RAILS_ROOT = File.dirname(File.expand_path(__FILE__)); | ||
|
||
class JavascriptTestTest < Test::Unit::TestCase | ||
|
||
def test_javascript_testrunner | ||
runner = JavaScriptTestrunner.new do |t| | ||
t.mount("/test", RAILS_ROOT+'/test') | ||
t.mount('/test/javascript/assets', RAILS_ROOT+'/../assets') | ||
t.run('test') | ||
|
||
t.browser(:firefox) | ||
end | ||
|
||
assert runner.successful? | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | ||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | ||
<head> | ||
<title>JavaScript unit test file</title> | ||
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> | ||
<script src="assets/prototype.js" type="text/javascript"></script> | ||
<script src="assets/unittest.js" type="text/javascript"></script> | ||
<link rel="stylesheet" href="assets/unittest.css" type="text/css" /> | ||
</head> | ||
<body> | ||
|
||
<div id="content"> | ||
|
||
<div id="header"> | ||
<h1>JavaScript unit test file</h1> | ||
<p> | ||
This file tests <strong>test.js</strong>. | ||
</p> | ||
</div> | ||
|
||
<!-- Log output --> | ||
<div id="testlog"> </div> | ||
|
||
</div> | ||
|
||
<script type="text/javascript"> | ||
// <![CDATA[ | ||
|
||
new Test.Unit.Runner({ | ||
|
||
// replace this with your real tests | ||
|
||
setup: function() { | ||
|
||
}, | ||
|
||
teardown: function() { | ||
|
||
}, | ||
|
||
testFluxiomObject: function() { with(this) { | ||
assert(true); | ||
}} | ||
|
||
}, "testlog"); | ||
// ]]> | ||
</script> | ||
</body> | ||
</html> |