Sha256: 1d3d22b2bdb13ce4d1bc6be43a07c3ac817ad24dd1795a1d36ac2c808be3ce05
Contents?: true
Size: 879 Bytes
Versions: 50
Compression:
Stored size: 879 Bytes
Contents
FactoryBot.define do factory :egov_utils_person, class: 'EgovUtils::Person' do transient do natural_attributes { Hash.new } end association :residence, factory: :egov_utils_address joid { SecureRandom.uuid } person_type { nil } natural_person { nil } legal_person { nil } trait :natural do person_type { 'natural' } after(:build) do |person, evaluator| evaluator.natural_person = FactoryBot.build(:egov_utils_natural_person, evaluator.natural_attributes.merge(person: person)) end end factory :natural_person, traits: [:natural] end factory :egov_utils_natural_person, class: 'EgovUtils::NaturalPerson' do firstname { 'John' } sequence(:lastname){|n| "Doe-#{n}"} birth_date { Date.today - (Random.new.rand(50)+18).years } association :person, factory: :egov_utils_person end end
Version data entries
50 entries across 50 versions & 1 rubygems