Created
February 16, 2011 22:48
-
-
Save plagelao/830456 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
Given a "XBox" with a price of "250€" | |
When I ask for the catalogue | |
Then I can see in the catalogue a "XBox" with a price of "250€" |
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
Given /^a "([^"]*)" with a price of "([^"]*)"$/ do |product, price| | |
Product.create(:name => product, :price => price) | |
end | |
When /^I ask for the catalogue$/ do | |
visit products_path | |
click_link "Catalogue" | |
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
Then /^I can see in the catalogue a "([^"]*)" with a price of "([^"]*)"$/ do |product, price| | |
first_row(page.body).should =~ Regexp.new("#{product} - #{price}") | |
end | |
def first_row(stream) | |
#Stuff to read an excel file | |
#Stuff to get the first line of the excel spreadsheet | |
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
Then /^I can see in the catalogue a "([^"]*)" with a price of "([^"]*)"$/ do |product, price| | |
page.body.should =~ Regexp.new("#{product} - #{price}") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment