public
Description: Webrat - Ruby Acceptance Testing for Web applications
Homepage: http://gitrdoc.com/brynary/webrat/tree/master/
Clone URL: git://github.com/brynary/webrat.git
webrat / spec / integration / sinatra / test / webrat_test.rb
100644 20 lines (15 sloc) 0.442 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require File.dirname(__FILE__) + "/test_helper"
 
class WebratTest < Test::Unit::TestCase
  def test_visits_pages
    visit "/"
    assert response_body.include?("visit")
 
    click_link "there"
    assert response_body.include?('<form method="post" action="/go">')
  end
  
  def test_submits_form
    visit "/go"
    fill_in "Name", :with => "World"
    click_button "Submit"
    
    assert response_body.include?("Hello, World")
  end
end