Open richardkmichael opened 13 years ago
Trying to save a built factory is broken, e.g.
project = Factory.build(:project) project.save
Because the user required by the Factory built project has not yet been saved. This user is saved during Factory.create(:project).
Factory.create(:project)
Work around:
project = Factory.build(:project) project.users.first.save project.save
Also, consider moving the factories to different files:
test/factories/user.rb test/factories/project.rb etc.
test/factories/user.rb
test/factories/project.rb
Trying to save a built factory is broken, e.g.
Because the user required by the Factory built project has not yet been saved. This user is saved during
Factory.create(:project)
.Work around:
Also, consider moving the factories to different files:
test/factories/user.rb
test/factories/project.rb
etc.