Hey guys,
I’ve been practicing TDD on my rails apps for a while now, and I’m
constantly plagued by factory girl and its association support. It
really irks me to see that a test failed because object A calls
a.association … on object B which calls b.association on … which
tries to instantiate a duplicate of object C, which already exists,
and so its uniqueness validations fail, causing the whole chain of the
test to explode.
I’ve been chasing this damn chicken-or-the-egg problem for a while,
but ultimately I’m wondering if it’s time to scrap factory girl and
look at something else. Problem is, most of the other alternatives,
Machinist being the primary one I know about, don’t appear to have
been updated to work with Rails 3 (and there’s no way I’m going back
to 2.x!).
So, that said, can you recommend some relatively recent and up-to-date
fixture replacement frameworks for Rails, or is factory_girl really
about my only option?
Thanks