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:
parent
d96fba1341
commit
2eaa06b22b
2 changed files with 3 additions and 3 deletions
|
@ -43,7 +43,7 @@ class Champs::PieceJustificativeChamp < Champ
|
||||||
end
|
end
|
||||||
|
|
||||||
def for_export
|
def for_export
|
||||||
piece_justificative_file.map { _1.filename.to_s }
|
piece_justificative_file.map { _1.filename.to_s }.join(', ')
|
||||||
end
|
end
|
||||||
|
|
||||||
def for_api
|
def for_api
|
||||||
|
|
|
@ -43,11 +43,11 @@ describe Champs::PieceJustificativeChamp do
|
||||||
let(:champ_pj) { create(:champ_piece_justificative) }
|
let(:champ_pj) { create(:champ_piece_justificative) }
|
||||||
subject { champ_pj.for_export }
|
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
|
context 'without attached file' do
|
||||||
before { champ_pj.piece_justificative_file.purge }
|
before { champ_pj.piece_justificative_file.purge }
|
||||||
it { is_expected.to eq([]) }
|
it { is_expected.to eq('') }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue