correctif(export.pjs): sur l'export, les champs de type piece justificative renvoyent un tableau de la meme dimension quelque soit le nombre de pj joint

This commit is contained in:
Martin 2022-12-06 15:05:37 +01:00
parent d96fba1341
commit 2eaa06b22b
2 changed files with 3 additions and 3 deletions

View file

@ -43,7 +43,7 @@ class Champs::PieceJustificativeChamp < Champ
end
def for_export
piece_justificative_file.map { _1.filename.to_s }
piece_justificative_file.map { _1.filename.to_s }.join(', ')
end
def for_api

View file

@ -43,11 +43,11 @@ describe Champs::PieceJustificativeChamp do
let(:champ_pj) { create(:champ_piece_justificative) }
subject { champ_pj.for_export }
it { is_expected.to match_array(['toto.txt']) }
it { is_expected.to eq('toto.txt') }
context 'without attached file' do
before { champ_pj.piece_justificative_file.purge }
it { is_expected.to eq([]) }
it { is_expected.to eq('') }
end
end