url-shortener/features/step_definitions/steps.rb

30 lines
518 B
Ruby

# GIVEN
Given('I visit the {string} page') do |string|
visit string
end
# WHEN
When('I click the submit button') do
click_button "Submit"
end
# THEN
Then('I should see text {string}') do |string|
page.should have_content string
end
Then('I should see a form field {string}') do |string|
page.should have_field string
end
Then('I should see a {string} button') do |string|
page.should have_button string
end
Then('I should be on {string} page') do |string|
page.should have_current_path string
end