Skip to content

Instantly share code, notes, and snippets.

@gvarela
Created October 5, 2011 22:13
Show Gist options
  • Save gvarela/1265899 to your computer and use it in GitHub Desktop.
Save gvarela/1265899 to your computer and use it in GitHub Desktop.
Then /^the following fields should be required:$/ do |fields|
fields.rows_hash.each do |field, custom_message|
node = find('input[type="submit"]', :message => "Unable to locate the submit button to click on")
node.click
Then %{the "#{field}" field should have the error "#{custom_message.presence || "can't be blank"}"}
end
end
Scenario: Required fields for the signup form
Given I am on the home page
When I follow "Sign up for an account"
Then the following fields should be required:
| Name | can't be blank |
| Email | can't be blank |
| Password ||
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment