brynary / webrat
- Source
- Commits
- Network (269)
- Issues (30)
- Wiki (10)
- Graphs
-
Tree:
499dcef
| 499dcefe » | foca | 2008-12-29 | 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 | ||||
