Skip to content

Instantly share code, notes, and snippets.

@robholland
Created February 25, 2009 13:38
Show Gist options
  • Save robholland/70161 to your computer and use it in GitHub Desktop.
Save robholland/70161 to your computer and use it in GitHub Desktop.
Scenario: Check balance amounts
Given accounts like
| name | balance |
| Current | 5 |
| Savings | 10 |
When I visit the accounts page
Then the account list should look like
| name | balance |
| Current | 5.00 |
| Savings | 10.00 |
Then /the (.*) list should look like$/ do |type, table|
columns = table.raw[0]
response.body.should have_selector("##{type}_list") { |list|
table.hashes.each_with_index do |row, index|
list.should have_selector(".#{type}") { |item|
columns.each { |column| item.should have_selector("*[text()='#{row[column]}']")}
}
end
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment