Skip to content

Instantly share code, notes, and snippets.

@coshx
Created September 29, 2010 21:43
Show Gist options
  • Save coshx/603624 to your computer and use it in GitHub Desktop.
Save coshx/603624 to your computer and use it in GitHub Desktop.
When /^(?:|I )fill in "([^\"]*)" with the (?:the )?(.+)\'s "([^\"]+)"(?: within "([^\"]*)")?$/ do |field, model, attrib, selector|
with_scope(selector) do
factory_name = model.gsub(' ', '_').to_sym
object = eval("@#{factory_name}")
fill_in(field, :with => object.send(attrib))
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment