970c3e4b2b
Calling business logic in a factory is a code-smell, because it usually requires the object to be saved into database, and may have unintended consequences when the business logic is changed. Also, this allows to just build a published procedure, without saving it to the database.
16 lines
300 B
Ruby
16 lines
300 B
Ruby
FactoryBot.define do
|
|
factory :individual do
|
|
gender { 'M.' }
|
|
nom { 'Julien' }
|
|
prenom { 'Xavier' }
|
|
birthdate { Date.new(1991, 11, 01) }
|
|
association :dossier
|
|
|
|
trait :empty do
|
|
gender { nil }
|
|
nom { nil }
|
|
prenom { nil }
|
|
birthdate { nil }
|
|
end
|
|
end
|
|
end
|