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

23 lines
529 B
Ruby
Raw Normal View History

2018-12-01 21:03:19 -05:00
# frozen_string_literal: true
FactoryBot.define do
2019-01-31 23:23:01 -05:00
factory :guest_account, class: Account do
2019-02-01 16:46:57 -05:00
public_name { Faker::Lorem.name }
2019-01-31 23:23:01 -05:00
biography { Faker::Lorem.paragraph }
end
2018-12-04 19:30:22 -05:00
factory :usual_account, parent: :guest_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
2018-12-09 22:36:09 -05:00
end
factory :superuser_account, parent: :personal_account do
2018-12-05 19:05:21 -05:00
after :create do |account, _evaluator|
account.add_role :superuser
end
end
2018-12-01 21:03:19 -05:00
end