Forum: Ruby on Rails Test Fixture Alternatives

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
3299251223f55753ec84719de39e6e53?d=identicon&s=25 Jon Garvin (Guest)
on 2006-12-29 21:23
(Received via mailing list)
We've run into an issue on a project with one fixture that's failing
because it's getting loaded before another fixture that it's dependent
on. Only happens on one test. Many other tests that use both fixtures
work fine.  After a little searching on the net, I find that we're not
the first to run into issues with the order in which fixtures get
loaded.  The best solution I've found mentioned is pretty much total
abandonment of fixtures and instead using helper methods that create
appropriate data.  The advantages seem to be a) solving the load order
problem we're having and b) tests run faster.  Nowhere that I see this
talked about do I see people discuss any disadvantages, so.... my
questions are?

Are there any disadvantages to using helper methods instead of fixtures?
What are they?

If helper methods really are more advantageous than fixtures, why isn't
it standard procedure to create the helper methods from the beginning?
Every bit of documentation I've read in regards to getting started in
testing says to create fixtures, with no hint of other, potentially more
appropriate, means of getting test data into the database.

Are there any other solutions to our problem that I haven't discovered?
This topic is locked and can not be replied to.