brynary / webrat

Webrat - Ruby Acceptance Testing for Web applications

This URL has Read+Write access

webrat / spec / integration / sinatra / test / webrat_test.rb
499dcefe » foca 2008-12-29 Add integration tests for s... 1 require File.dirname(__FILE__) + "/test_helper"
2
3 class WebratTest < Test::Unit::TestCase
4 def test_visits_pages
5 visit "/"
6 assert response_body.include?("visit")
7
8 click_link "there"
9 assert response_body.include?('<form method="post" action="/go">')
10 end
11
12 def test_submits_form
13 visit "/go"
14 fill_in "Name", :with => "World"
15 click_button "Submit"
16
17 assert response_body.include?("Hello, World")
18 end
19 end