Tricks and Tips for using Fixtures effectively in Rails (blog.bigbinary.com)

The biggest takeaway: don’t use ids unless absolutely necessary. Rely on the autogenerated, deterministic ids, and you get a bunch of behavior for free.