ensl.org/spec/factories/group.rb

40 lines
681 B
Ruby
Raw Normal View History

2015-05-14 16:27:12 +00:00
FactoryGirl.define do
factory :group do
2015-11-07 06:21:09 +00:00
sequence(:id) { |n| n + 100 } # Preserve first 100
2015-05-14 16:27:12 +00:00
sequence(:name) { |n| "Group#{n}" }
association :founder, factory: :user
2015-11-07 06:21:09 +00:00
initialize_with { Group.find_or_create_by_id(id) }
2015-05-14 16:27:12 +00:00
end
trait :admin do
2015-11-07 06:21:09 +00:00
name "Admins"
id Group::ADMINS
end
trait :caster do
name "Shoutcasters"
id Group::CASTERS
2015-05-14 16:27:12 +00:00
end
2015-08-15 12:25:44 +00:00
trait :champions do
2015-11-07 06:21:09 +00:00
name "Champions"
id Group::CHAMPIONS
2015-08-15 12:25:44 +00:00
end
trait :donors do
2015-11-07 06:21:09 +00:00
name "Donors"
id Group::DONORS
2015-08-15 12:25:44 +00:00
end
2015-10-20 17:04:50 +00:00
trait :gather_moderator do
name "Gather Moderator"
id Group::GATHER_MODERATORS
end
2015-11-07 06:21:09 +00:00
trait :ref do
name "Referees"
id Group::REFEREES
end
2015-05-14 16:27:12 +00:00
end