demarches-normaliennes/spec/factories/individual.rb
Pierre de La Morinerie 970c3e4b2b specs: avoid executing business logic in Procedure factory
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.
2021-11-23 08:07:07 +01:00

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