Created
May 31, 2011 03:07
-
-
Save jt/999803 to your computer and use it in GitHub Desktop.
Cucumber tabular steps for tables and lists
This file contains hidden or 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 )should see the following table:$/ do |table| | |
table.diff! tableish("table tr", "td,th") | |
end | |
Then /^(?:|I )should see the following list:$/ do |table| | |
table.raw.each_with_index do |element, i| | |
page.should have_xpath("//li[#{i+1}][contains(normalize-space(.), '#{element.first}')]") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment