2020-03-15 13:33:58 +00:00
|
|
|
FactoryBot.define do
|
2014-03-23 00:22:25 +00:00
|
|
|
factory :user do
|
2014-03-30 19:50:52 +00:00
|
|
|
sequence(:username) { |n| "Player#{n}" }
|
|
|
|
sequence(:email) { |n| "player#{n}@ensl.org" }
|
|
|
|
sequence(:steamid) { |n| "0:1:#{n}" }
|
|
|
|
|
2014-03-23 00:22:25 +00:00
|
|
|
firstname "ENSL"
|
|
|
|
lastname "Player"
|
|
|
|
country "EU"
|
|
|
|
raw_password "PasswordABC123"
|
2020-03-21 20:33:44 +00:00
|
|
|
# lastvisit "Sun, 15 Mar 2020 13:31:06 +0000"
|
2014-03-29 00:59:26 +00:00
|
|
|
|
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
|
|
|
|
|
2015-11-07 06:21:09 +00:00
|
|
|
trait :caster do
|
|
|
|
after(:create) do |user|
|
|
|
|
group = create(:group, :caster)
|
|
|
|
create :grouper, user: user, group: group
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
trait :ref do
|
|
|
|
after(:create) do |user|
|
|
|
|
group = create(:group, :ref)
|
|
|
|
create :grouper, user: user, group: group
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2015-07-21 13:27:33 +00:00
|
|
|
trait :chris do
|
|
|
|
steamid "0:1:58097444"
|
|
|
|
end
|
|
|
|
|
2014-03-29 00:59:26 +00:00
|
|
|
factory :user_with_team do
|
|
|
|
after(:create) do |user|
|
|
|
|
create(:team, founder: user)
|
|
|
|
end
|
|
|
|
end
|
2014-03-23 00:22:25 +00:00
|
|
|
end
|
2014-03-29 00:59:26 +00:00
|
|
|
end
|