Skip to content

Instantly share code, notes, and snippets.

@gauravsaini23
Forked from richardlawrence/gist:1299371
Created December 15, 2011 11:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gauravsaini23/1480785 to your computer and use it in GitHub Desktop.
Save gauravsaini23/1480785 to your computer and use it in GitHub Desktop.
Convert a Capybara table to something you can diff with a Cucumber table
# add this method to enable method tableish in a different way
module WithinHelpers
def tableish(id)
find('table' + '#' + id).all('tr').map { |row| row.all('th, td').map { |cell| cell.text.strip } }
end
end
World(WithinHelpers)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment