fix(export): no crash on empty repetitions
This commit is contained in:
parent
8e73a4f037
commit
bbc44fe339
3 changed files with 16 additions and 3 deletions
|
@ -405,6 +405,18 @@ describe ProcedureExportService do
|
|||
expect(subject.sheets.map(&:name)).to eq(['Dossiers', 'Etablissements', 'Avis', another_champ_repetition.libelle_for_export, champ_repetition.libelle_for_export])
|
||||
end
|
||||
end
|
||||
|
||||
context 'with empty repetition' do
|
||||
before do
|
||||
dossiers.flat_map { |dossier| dossier.champs.filter(&:repetition?) }.each do |champ|
|
||||
champ.champs.destroy_all
|
||||
end
|
||||
end
|
||||
|
||||
it 'should not have data' do
|
||||
expect(repetition_sheet).to be_nil
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue