[rspec-users] tests using factorygirl

Julian Leviston julian at leviston.net
Thu Mar 1 05:35:51 UTC 2012

Nah I had this issue, too... use this

FactoryGirl.... do
assocation :location, etc. (look it up)

On 01/03/2012, at 4:19 PM, S Ahmed wrote:

> I'm trying to use factory for a test case, but the model I am creating via the factory depends on another model, how do you setup a factory like this?
> Model Account has a location_id attribute (where Location is another model)
> So how do I set it?
> FactoryGirl..... do
>   location_id  ????????/
> end
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

More information about the rspec-users mailing list