I\'m reading about Rails fixtures in this guide (thanks, trevorturk). It appears you define classes in a Yaml file and they\'re automatically loaded into the test
Additionally, if you wish to have a many to many association ( HABTM ) you just give an array for the association in the fixture:
# recipes.yml
chicken_soup:
cookbooks: [my_recipes, another_recipe]
You should use named fixtures, which automatically generate an id number for you where you don't provide one. These id numbers are essentially integer hashes of whatever string you use. Don't add the "_id" if you're referencing the named version:
# recipes.yml
chicken_soup:
cookbook: my_recipes
# cookbooks.yml
my_recipes:
title: My Test Cookbook