2011-02-24 07:09:59 -05:00
|
|
|
When /^I visit the (?:root|home) page$/ do
|
2011-02-06 08:34:32 -05:00
|
|
|
visit('/')
|
|
|
|
end
|
|
|
|
|
|
|
|
Then /^I should see "([^"]*)"$/ do |text|
|
|
|
|
page.should have_content(text)
|
|
|
|
end
|
|
|
|
|
|
|
|
Then /^Capybara should use the "([^"]*)" driver$/ do |driver|
|
|
|
|
Capybara.current_driver.should == driver.to_sym
|
|
|
|
end
|
2011-02-06 08:44:43 -05:00
|
|
|
|
|
|
|
When /^I use a matcher that fails$/ do
|
|
|
|
begin
|
|
|
|
page.should have_css('h1#doesnotexist')
|
|
|
|
rescue StandardError => e
|
|
|
|
@error_message = e.message
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
Then /^the failing exception should be nice$/ do
|
2012-07-10 05:23:24 -04:00
|
|
|
@error_message.should =~ %r(expected to find css \"h1#doesnotexist\")
|
2011-02-06 08:44:43 -05:00
|
|
|
end
|
|
|
|
|