Skip to content

Instantly share code, notes, and snippets.

@leemcalilly
Created May 22, 2013 17:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leemcalilly/5629182 to your computer and use it in GitHub Desktop.
Save leemcalilly/5629182 to your computer and use it in GitHub Desktop.
FactoryGirl.define do
factory :user do
sequence(:email) { |n| "person_#{n}@example.com"}
password "secret"
password_confirmation "secret"
factory :admin do
after(:create) {|user| user.add_role(:admin)}
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment