views:

126

answers:

1

How do you prefer to organize your test data in Ruby On Rails: fixtures, object factories or anything else? Why?

A: 

Object factories are far less brittle than fixtures, and when they break because you've been mucking around with the database schema, there's much less work to do to fix them. Some gems also know how to intelligently auto-construct associations between factory objects.

Factory Girl and Machinist are currently in vogue right now. I use Faker, too, to generate random strings; not strictly necessary, but kind of fun.

Raphomet