Last active
December 23, 2015 22:49
-
-
Save tdouce/6705737 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
# spec/factories/users.rb | |
FactoryGirl.define do | |
factory :user do | |
sequence(:email) { |n| "user#{n}@bignerdranch.com" } | |
sequence(:username) { |n| "user#{n}" } | |
password 'test123' | |
password_confirmation 'test123' | |
terms_of_use true | |
confirmed_at Time.now | |
role 'teacher' | |
association :teacher, factory: :teacher | |
end | |
factory :lite_user, parent: :user do | |
email '[email protected]' | |
account_type 'lite' | |
confirmed_at Time.now | |
end | |
factory :student_user, parent: :user do | |
role User::STUDENT | |
association :student, factory: :student | |
end | |
end | |
# spec/factories/teachers.rb | |
FactoryGirl.define do | |
factory :teacher do | |
account_type Teacher::LITE | |
viewed_tutorial true | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment