Skip to content

Instantly share code, notes, and snippets.

@saroar
Forked from emk/form_steps.rb
Created April 11, 2017 14:18
Show Gist options
  • Save saroar/e4ba4cd57d38d2f2539237005c4c4c02 to your computer and use it in GitHub Desktop.
Save saroar/e4ba4cd57d38d2f2539237005c4c4c02 to your computer and use it in GitHub Desktop.
Fill in multiline forms with Cucumber and Webrat
# Fill in multiple form fields using a table. Use it as follows:
#
# When I fill in the fields
# | Field 1 | Value 1 |
# | Field 2 | Value 2 |
When /^I fill in the fields$/ do |table|
table.rows_hash.each {|field, value| fill_in field, :with => value }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment