1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
lpr-partynest/factories/relationships.rb

54 lines
1.4 KiB
Ruby
Raw Normal View History

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
sequence :from_date do |n|
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-06-04 22:33:45 -04:00
factory :excluded_supporter_relationship, parent: :supporter_relationship do
status { :excluded }
end
factory :excluded_member_relationship, parent: :member_relationship do
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
factory :regional_manager_relationship, parent: :member_relationship do
role { :regional_manager }
2019-07-20 05:12:58 -04:00
end
factory :regional_supervisor_relationship, parent: :member_relationship do
role { :regional_supervisor }
2019-07-20 05:12:58 -04:00
end
factory :federal_secretary_relationship,
parent: :federal_manager_relationship do
federal_secretary_flag { :federal_secretary }
end
factory :regional_secretary_relationship,
parent: :regional_manager_relationship do
regional_secretary_flag { :regional_secretary }
end
2019-04-27 10:24:04 -04:00
end