2019-04-27 10:24:04 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
FactoryBot.define do
|
|
|
|
factory :supporter_relationship, class: Relationship do
|
|
|
|
association :person, factory: :initial_person
|
2019-04-28 08:48:51 -04:00
|
|
|
association :regional_office
|
2019-08-14 22:59:11 -04:00
|
|
|
association :initiator_account, factory: :superuser_account
|
2019-04-28 08:48:51 -04:00
|
|
|
|
2019-07-20 02:22:47 -04:00
|
|
|
sequence :from_date do |n|
|
2019-06-04 21:37:55 -04:00
|
|
|
Date.new rand((10 * n)...(11 * n)), rand(1..12), rand(1..28)
|
|
|
|
end
|
2019-06-04 22:33:45 -04:00
|
|
|
|
|
|
|
status { :supporter }
|
2019-07-20 05:12:58 -04:00
|
|
|
role { nil }
|
2019-04-28 08:48:51 -04:00
|
|
|
end
|
|
|
|
|
2019-07-26 00:07:18 -04:00
|
|
|
factory :excluded_relationship, parent: :supporter_relationship do
|
2019-06-04 22:33:45 -04:00
|
|
|
status { :excluded }
|
|
|
|
end
|
2019-07-20 05:12:58 -04:00
|
|
|
|
|
|
|
factory :member_relationship, parent: :supporter_relationship do
|
|
|
|
status { :member }
|
|
|
|
end
|
|
|
|
|
2019-07-25 22:06:01 -04:00
|
|
|
factory :federal_manager_relationship, parent: :member_relationship do
|
|
|
|
role { :federal_manager }
|
|
|
|
end
|
|
|
|
|
2019-07-25 22:09:52 -04:00
|
|
|
factory :federal_supervisor_relationship, parent: :member_relationship do
|
|
|
|
role { :federal_supervisor }
|
|
|
|
end
|
|
|
|
|
2019-07-25 21:50:57 -04:00
|
|
|
factory :regional_manager_relationship, parent: :member_relationship do
|
|
|
|
role { :regional_manager }
|
2019-07-20 05:12:58 -04:00
|
|
|
end
|
|
|
|
|
2019-07-25 21:53:21 -04:00
|
|
|
factory :regional_supervisor_relationship, parent: :member_relationship do
|
|
|
|
role { :regional_supervisor }
|
2019-07-20 05:12:58 -04:00
|
|
|
end
|
2019-07-25 23:22:12 -04:00
|
|
|
|
|
|
|
factory :federal_secretary_relationship,
|
|
|
|
parent: :federal_manager_relationship do
|
|
|
|
federal_secretary_flag { :federal_secretary }
|
|
|
|
end
|
2019-07-25 23:40:06 -04:00
|
|
|
|
|
|
|
factory :regional_secretary_relationship,
|
|
|
|
parent: :regional_manager_relationship do
|
|
|
|
regional_secretary_flag { :regional_secretary }
|
|
|
|
end
|
2019-04-27 10:24:04 -04:00
|
|
|
end
|