can someone provide an example or point me to where I can learn how to do Factory Girl nested model associations?
A Thread has to have at least one ThreadParticipation
Right now I have my thread in factories.rb as follows:
Factory.define :thread do |thread|
thread.title "mythread"
end
How do I then create a ThreadParticipation?
Thanks
The Getting Started file in the factory_girl source has info on associations.
So, in your instance, I would imagine something like this would do:
If you’re using a collection instead of a
has_one/belongs_toassociation, you can create an array as such: