Skip to content

Instantly share code, notes, and snippets.

@abacha
Created March 19, 2013 20:34
Show Gist options
  • Select an option

  • Save abacha/5199870 to your computer and use it in GitHub Desktop.

Select an option

Save abacha/5199870 to your computer and use it in GitHub Desktop.
factory :user do
sequence(:email) { |n| "user#{n}@mail.com" }
password "password"
ignore do
role "Client"
end
after(:build) do |user, e|
user.roles = [Role.new(:name => e.role)]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment