rails_generators/pickle/templates/pickle_steps.rb in pickle-0.1.18 vs rails_generators/pickle/templates/pickle_steps.rb in pickle-0.1.19
- old
+ new
@@ -8,9 +8,15 @@
# create n models
Given(/^(\d+) #{capture_plural_factory} exist(?: with #{capture_fields})?$/) do |count, plural_factory, fields|
count.to_i.times { create_model(plural_factory.singularize, fields) }
end
+# create models from a table
+Given /^the following #{capture_plural_factory} exist$/ do |plural_factory, table|
+ name = plural_factory.singularize
+ table.hashes.each { |hash| create_model(name, hash) }
+end
+
# find a model
Then(/^#{capture_model} should exist(?: with #{capture_fields})?$/) do |name, fields|
find_model(name, fields).should_not be_nil
end
\ No newline at end of file