Skip to content

Instantly share code, notes, and snippets.

@jalcine
Forked from enricostano/factories.rb
Created January 5, 2014 14:39
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 jalcine/8268954 to your computer and use it in GitHub Desktop.
Save jalcine/8268954 to your computer and use it in GitHub Desktop.
factory :user do
name "Jessie Pinkman"
email
password "secret"
password_confirmation "secret"
trait :group_admin do
ignore do
group = nil
end
after(:create) { |user, evaluator| user.add_role :admin, evaluator.group }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment