1
0
Fork 0
mirror of https://github.com/thoughtbot/factory_bot.git synced 2022-11-09 11:43:51 -05:00

Use create_list in step definitions

Closes #213
This commit is contained in:
Vasiliy Ermolovich 2011-10-10 19:22:14 +03:00 committed by Joshua Clayton
parent f32651d9b2
commit 9fcd0b6b4e

View file

@ -109,7 +109,7 @@ FactoryGirl.factories.each do |factory|
end
Given /^(\d+) #{human_name.pluralize} exist$/i do |count|
count.to_i.times { FactoryGirl.create(factory.name) }
FactoryGirl.create_list(factory.name, count.to_i)
end
if factory.build_class.respond_to?(:columns)
@ -120,7 +120,7 @@ FactoryGirl.factories.each do |factory|
end
Given /^(\d+) #{human_name.pluralize} exist with an? #{human_column_name} of "([^"]*)"$/i do |count, value|
count.to_i.times { FactoryGirl.create(factory.name, column.name => value) }
FactoryGirl.create_list(factory.name, count.to_i, column.name => value)
end
end
end