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

21 lines
514 B
Ruby

# frozen_string_literal: true
FactoryBot.define do
factory :some_root_org_unit, class: OrgUnit do
short_name { name }
name { Faker::Company.unique.name }
association :kind, factory: :some_root_org_unit_kind
trait :with_parent do
association :kind, factory: :some_children_org_unit_kind
parent_unit { create :some_root_org_unit, kind: kind.parent_kind }
end
end
factory :some_children_org_unit,
parent: :some_root_org_unit,
traits: %i[with_parent]
end