Skip to content

Instantly share code, notes, and snippets.

@levicole
Created August 25, 2010 21:00
Show Gist options
  • Select an option

  • Save levicole/550285 to your computer and use it in GitHub Desktop.

Select an option

Save levicole/550285 to your computer and use it in GitHub Desktop.
Given /^I am on the "([^"]*)" item page$/ do |arg1|
@item = Factory(:item, :name => arg1)
visit item_path(@item)
end
Then /^I see the add to cart button$/ do
page.should have_css("button", :text => "Add to cart")
end
When /^I click the "([^"]*)" button$/ do |arg1|
click_button arg1
end
Then /^I am on the cart page$/ do
current_url.should == cart_url
end
Then /^I see the "([^"]*)" in my cart$/ do |arg1|
page.should have_css("table#cart tr td.item_name", :text => arg1)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment