Created
March 24, 2010 22:11
-
-
Save paulca/342890 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'webrat' | |
Webrat.configure do |config| | |
config.mode = :mechanize | |
end | |
class MechanizeWorld < Webrat::MechanizeAdapter | |
include Webrat::Matchers | |
include Webrat::Methods | |
# no idea why we need this but without it response_code is not always recognized | |
Webrat::Methods.delegate_to_session :response_code, :response_body | |
end | |
World do | |
MechanizeWorld.new | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Google | |
As a user | |
I want to load google | |
Scenario: Google | |
When I go to http://www.google.com | |
Then I should see "Google" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril. | |
# It is recommended to regenerate this file in the future when you upgrade to a | |
# newer version of cucumber-rails. Consider adding your own code to a new file | |
# instead of editing this one. Cucumber will automatically load all features/**/*.rb | |
# files. | |
require 'uri' | |
When /^(?:|I )go to (.+)$/ do |page_name| | |
visit page_name | |
end | |
Then /^(?:|I )should see "([^\"]*)"$/ do |text| | |
response_body.should contain(text) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment