Skip to content

Instantly share code, notes, and snippets.

@leifbladt
Forked from richardlawrence/gist:1299371
Created October 25, 2011 14:06
Show Gist options
  • Save leifbladt/1312840 to your computer and use it in GitHub Desktop.
Save leifbladt/1312840 to your computer and use it in GitHub Desktop.
Convert a Capybara table to something you can diff with a Cucumber table
# change 'table' to a more specific selector when the page will have more than one table
find('table').all('tr').map { |row| row.all('th, td').map { |cell| cell.text.strip } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment