Skip to content

Instantly share code, notes, and snippets.

@heim
Created May 4, 2009 13:29
Show Gist options
  • Save heim/106464 to your computer and use it in GitHub Desktop.
Save heim/106464 to your computer and use it in GitHub Desktop.
Factory.define :category do |c|
c.sequence(:name) { |n| "Category #{n}" }
end
Factory.define :post do |p|
p.sequence(:title) { |n| "Title#{n}" }
p.body "Body"
p.categories [Factory(:category), Factory(:category)]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment