webrat/spec/integration/merb/spec/webrat_spec.rb
2009-01-04 23:56:52 -05:00

27 lines
657 B
Ruby

require File.expand_path(File.join(File.dirname(__FILE__), "spec_helper"))
describe "Webrat" do
it "should visit pages" do
response = visit "/"
response.should contain("Webrat Form")
end
it "should submit forms" do
visit "/"
fill_in "Text field", :with => "Hello"
check "TOS"
select "January"
click_button "Test"
end
it "should follow internal redirects" do
response = visit "/internal_redirect"
response.status.should == 200
response.should contain("Webrat Form")
end
it "should not follow external redirects" do
response = visit "/external_redirect"
response.status.should == 302
end
end