The alternative is to stop building so many dependencies between your models so you don't need a tool like factory_girl at all! No fixtures, no factories, make only and exactly what you need for each test. If that test setup is getting untenable, that's test pain! Yay! Now refactor your code and fix the pain properly by reducing coupling.
The problem with factory_girl is that it lets you hide this pain instead of fix it, letting you get on with building massively coupled systems that turn into maintenance nightmares.
As a side note your unit tests should never hit the database or any external service. Your unit test suite should finish in at most a few seconds. If it's slower than that you have problems.
The problem with factory_girl is that it lets you hide this pain instead of fix it, letting you get on with building massively coupled systems that turn into maintenance nightmares.
As a side note your unit tests should never hit the database or any external service. Your unit test suite should finish in at most a few seconds. If it's slower than that you have problems.