bug(dossier.export.pdf): l'export au format pdf d'un dossier ayant un champ de type repetition contenant un titre est bizarre

This commit is contained in:
Martin 2023-03-06 16:23:14 +01:00 committed by mfo
parent 6e86a0e622
commit 401ead47f0

View file

@ -1317,6 +1317,18 @@ describe Dossier do
end
end
describe 'index_for_section_header' do
let(:procedure) { create(:procedure, types_de_champ_public: types_de_champ) }
let(:dossier) { create(:dossier, procedure: procedure) }
let(:types_de_champ) { [{ type: :repetition, mandatory: true, children: [{ type: :header_section }] }] }
it 'index classly' do
repetition = dossier.champs.find(&:repetition?)
header_in_repetition = repetition.champs.find(&:header_section?)
expect(dossier.index_for_section_header(header_in_repetition)).to eq("1.1")
end
end
describe '#repasser_en_instruction!' do
let(:dossier) { create(:dossier, :refuse, :with_attestation, archived: true, termine_close_to_expiration_notice_sent_at: Time.zone.now) }
let!(:instructeur) { create(:instructeur) }