2009-01-13 06:26:49 +00:00
|
|
|
require 'test_helper'
|
|
|
|
|
|
|
|
class WebratTest < ActionController::IntegrationTest
|
|
|
|
test "should visit pages" do
|
|
|
|
visit root_path
|
|
|
|
assert_contain("Webrat Form")
|
|
|
|
end
|
|
|
|
|
|
|
|
test "should submit forms" do
|
|
|
|
visit root_path
|
|
|
|
fill_in "Text field", :with => "Hello"
|
|
|
|
check "TOS"
|
|
|
|
select "January"
|
|
|
|
click_button "Test"
|
|
|
|
end
|
|
|
|
|
|
|
|
test "should follow internal redirects" do
|
|
|
|
visit internal_redirect_path
|
|
|
|
assert response_body.include?("OK")
|
|
|
|
end
|
|
|
|
|
|
|
|
test "should not follow external redirects" do
|
|
|
|
visit external_redirect_path
|
|
|
|
assert response.redirect?
|
|
|
|
end
|
2009-01-14 04:35:58 +00:00
|
|
|
|
|
|
|
test "should click link by text" do
|
|
|
|
visit internal_redirect_path
|
|
|
|
click_link "Test Link Text"
|
|
|
|
assert_contain("Webrat Form")
|
|
|
|
end
|
2009-01-14 04:43:14 +00:00
|
|
|
|
|
|
|
test "should click link by id" do
|
|
|
|
visit internal_redirect_path
|
|
|
|
click_link "link_id"
|
|
|
|
assert_contain("Webrat Form")
|
|
|
|
end
|
2009-01-13 06:26:49 +00:00
|
|
|
end
|