Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Then /^I should see a form for "(.+)" containing (.+) fields$/ do |object, methods|
fields = methods.scan(/(\w+)(?:,|\sand\s|\s)?/).flatten
response.should have_selector(:form) do |form|
fields.each do |field|
form.to_s.should have_selector("input", :id => "#{object}_#{field}")
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment