features/step_definitions/pickle_steps.rb in pickle-0.2.2 vs features/step_definitions/pickle_steps.rb in pickle-0.2.3
- old
+ new
@@ -10,11 +10,10 @@
count.to_i.times { create_model(plural_factory.singularize, fields) }
end
# create models from a table
Given(/^the following #{capture_plural_factory} exists?:?$/) do |plural_factory, table|
- name = plural_factory.singularize
- table.hashes.each { |hash| create_model(name, hash) }
+ create_models_from_table(plural_factory, table)
end
# find a model
Then(/^#{capture_model} should exist(?: with #{capture_fields})?$/) do |name, fields|
find_model!(name, fields)