webrat/spec/integration/rails/test/selenium/webrat_test.rb

33 lines
726 B
Ruby
Raw Normal View History

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
end