mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-18 16:20:12 +01:00
Removed superfluous 'tracks' directory at the root of the repository.
Testing commits to github.
This commit is contained in:
parent
6a42901514
commit
4cbf5a34d3
2269 changed files with 0 additions and 0 deletions
48
vendor/plugins/selenium-on-rails/test/selenium_controller_test.rb
vendored
Normal file
48
vendor/plugins/selenium-on-rails/test/selenium_controller_test.rb
vendored
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
require File.dirname(__FILE__) + '/test_helper'
|
||||
require "selenium_controller"
|
||||
|
||||
class SeleniumControllerTest < Test::Unit::TestCase
|
||||
|
||||
def setup
|
||||
@controller = SeleniumController.new
|
||||
@request = ActionController::TestRequest.new
|
||||
@response = ActionController::TestResponse.new
|
||||
@result_dir = File.join(File.dirname(__FILE__), "..", "test_result")
|
||||
end
|
||||
|
||||
def teardown
|
||||
FileUtils.rm_rf @result_dir
|
||||
end
|
||||
|
||||
def test_record_with_result
|
||||
SeleniumOnRailsConfig.configs["result_dir"] = @result_dir
|
||||
suite = <<EOS
|
||||
<script>
|
||||
</script>
|
||||
<table>
|
||||
<tr><td bgcolor="#ccffcc"><a href="/selenium/tests/foo.sel">Foo</a></td></tr>
|
||||
<tr><td bgcolor="#ccffcc"><a href="/selenium/tests/bar.sel">Bar</a></td></tr>
|
||||
</table>
|
||||
EOS
|
||||
post :record, :suite => suite,
|
||||
"testTable.1" => "<table></table>",
|
||||
"testTable.2" => "<table></table>"
|
||||
cur_result_dir = File.join(@result_dir, "default")
|
||||
assert File.directory?(cur_result_dir)
|
||||
assert_equal ["blank.html", "index.html", "suite.html", "test1.html", "test2.html"],
|
||||
Dir.glob("#{cur_result_dir}/*.html").map{|path| File.basename(path)}.sort
|
||||
expected = <<EOS
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" type="text/css" href="selenium-test.css">
|
||||
</head>
|
||||
<body>
|
||||
<table>
|
||||
<tr><td bgcolor="#ccffcc"><a href="test1.html" target="testcase">Foo</a></td></tr>
|
||||
<tr><td bgcolor="#ccffcc"><a href="test2.html" target="testcase">Bar</a></td></tr>
|
||||
</table>
|
||||
</body></html>
|
||||
EOS
|
||||
assert_equal expected, File.read("#{cur_result_dir}/suite.html")
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue