ensl.org/spec/factories/user.rb

30 lines
638 B
Ruby
Raw Normal View History

FactoryGirl.define do
factory :user do
sequence(:username) { |n| "Player#{n}" }
sequence(:email) { |n| "player#{n}@ensl.org" }
sequence(:steamid) { |n| "0:1:#{n}" }
firstname "ENSL"
lastname "Player"
country "EU"
raw_password "PasswordABC123"
after(:create) do |user|
create(:profile, user: user)
end
2015-05-14 16:27:12 +00:00
trait :admin do
after(:create) do |user|
group = create(:group, :admin)
create :grouper, user: user, group: group
end
end
factory :user_with_team do
after(:create) do |user|
create(:team, founder: user)
end
end
end
end