Skip to content

Instantly share code, notes, and snippets.

@nruth
Created June 11, 2010 01:13
Show Gist options
  • Save nruth/433895 to your computer and use it in GitHub Desktop.
Save nruth/433895 to your computer and use it in GitHub Desktop.
Given /^#{capture_model} has a question: "([^\"]*)"$/ do |model_name, question|
model = model! model_name
store_model "question", '', model.questions.make(:question => question)
end
Given /^#{capture_model} has a question$/ do |model_name|
model = model! model_name
factory, name_or_index = *parse_model(%Q(question)) #pickle internals
store_model factory, name_or_index, model.questions.make
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment