Created
November 13, 2011 16:01
-
-
Save serbrech/1362260 to your computer and use it in GitHub Desktop.
sequence of hash with factory_girl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Factory.sequence :writer_hash do |n| | |
{ | |
"id" => "#{n}", | |
"name" => "name#{n}", | |
"article" => { | |
"id" => "#{n}", | |
"title" => "post title #{n}" | |
} | |
} | |
end | |
factory :publisher do |p| | |
l.association :owner, :factory => :user | |
l.raw_writers [Factory.next :writer_hash, Factory.next :writer_hash, Factory.next :writer_hash ] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment