Is there any way I can require a small set of data be in the test
database before any tests are run? (unit, functional, integration,
cucumber, etc)
Any way besides using fixtures, that is.
Overload a rake task?
Modify test_helper?
Any ideas?
(Simple Case: I have to have a minimal set of user roles defined
before any users can be created)
Look at rake db:seed as one alternative.
Steve R. wrote:
On Jan 29, 2010, at 11:22 AM, kkohrt wrote:
Is there any way I can require a small set of data be in the test
database before any tests are run? (unit, functional, integration,
cucumber, etc)
Any way besides using fixtures, that is.
Overload a rake task?
Modify test_helper?
Any ideas?
(Simple Case: I have to have a minimal set of user roles defined
before any users can be created)I use fixture replacements such as Fixjour or machinist. So,
1.upto(10) do
Model.make # Machinist
endThat sort of thing. It’s good to put in a setup step.
Yes, factories are generally the best solution.
Best,
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
On Jan 29, 2010, at 11:22 AM, kkohrt wrote:
Is there any way I can require a small set of data be in the test
database before any tests are run? (unit, functional, integration,
cucumber, etc)
Any way besides using fixtures, that is.
Overload a rake task?
Modify test_helper?
Any ideas?
(Simple Case: I have to have a minimal set of user roles defined
before any users can be created)
I use fixture replacements such as Fixjour or machinist. So,
1.upto(10) do
Model.make # Machinist
end
That sort of thing. It’s good to put in a setup step.