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/accounts.rb

27 lines
653 B
Ruby
Raw Normal View History

2018-12-01 21:03:19 -05:00
# frozen_string_literal: true
FactoryBot.define do
2019-09-01 07:27:18 -04:00
factory :initial_account, class: Account do
2019-09-04 18:05:00 -04:00
association :contact_list, factory: :empty_contact_list
2019-07-08 10:24:42 -04:00
public_name { Faker::Name.name }
2019-01-31 23:23:01 -05:00
biography { Faker::Lorem.paragraph }
2019-09-03 13:16:21 -04:00
timezone { "#{[nil, :-].sample}#{rand(1..11).to_s.rjust(2, '0')}:00:00" }
2019-01-31 23:23:01 -05:00
end
2018-12-04 19:30:22 -05:00
2019-09-01 07:27:18 -04:00
factory :usual_account, parent: :initial_account do
2018-12-01 21:50:10 -05:00
association :user
2018-12-01 21:03:19 -05:00
end
2018-12-05 19:05:21 -05:00
2018-12-09 22:36:09 -05:00
factory :personal_account, parent: :usual_account do
association :person, factory: :initial_person
2019-09-04 18:05:00 -04:00
contact_list { person&.contact_list }
2018-12-09 22:36:09 -05:00
end
factory :superuser_account, parent: :personal_account do
2019-08-11 15:27:06 -04:00
superuser { true }
2018-12-05 19:05:21 -05:00
end
2018-12-01 21:03:19 -05:00
end