feat(piece_justificative): supports multiple files

Closes #7924
This commit is contained in:
Colin Darie 2022-10-25 14:14:24 +02:00
parent ab1928dc33
commit b8296c6d4d
17 changed files with 242 additions and 78 deletions

View file

@ -162,8 +162,13 @@ FactoryBot.define do
factory :champ_titre_identite, class: 'Champs::TitreIdentiteChamp' do
type_de_champ { association :type_de_champ_titre_identite, procedure: dossier.procedure }
transient do
skip_default_attachment { false }
end
after(:build) do |champ, evaluator|
next if evaluator.skip_default_attachment
after(:build) do |champ, _evaluator|
champ.piece_justificative_file.attach(
io: StringIO.new("toto"),
filename: "toto.png",