Last active
December 17, 2015 07:28
-
-
Save robyurkowski/5572738 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FactoryGirl.define do | |
factory :user do | |
sequence(:email) { |n| "email#{n}@example.com" } | |
password "secret" | |
factory :admin do | |
after_build {|u| u.roles << :admin } | |
end | |
end | |
end | |
# And then use it like this... | |
admin_user = FactoryGirl.create(:admin) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment