Permalink
Browse files

Use create_list in step definitions

Closes #213
  • Loading branch information...
1 parent f32651d commit 9fcd0b6b4e514688265a33c5396c6df3ced4aaff @nashby nashby committed with joshuaclayton Oct 10, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/factory_girl/step_definitions.rb
@@ -109,7 +109,7 @@ def initialize(human_hash_to_attributes_hash, key, value)
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 @@ def initialize(human_hash_to_attributes_hash, key, value)
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

0 comments on commit 9fcd0b6

Please sign in to comment.