specs: add a test for dossier_vide.pdf.prawn

This commit is contained in:
Pierre de La Morinerie 2022-05-04 14:03:19 +00:00
parent 137cb619d5
commit 0e60830102
2 changed files with 17 additions and 1 deletions

View file

@ -199,7 +199,7 @@ prawn_document(page_size: "A4") do |pdf|
pdf.text "\n" pdf.text "\n"
add_title(pdf, 'Formulaire') add_title(pdf, 'Formulaire')
add_single_line(pdf, @procedure.description + "\n", 9, :italic) if @procedure.description.present? add_single_line(pdf, @dossier.procedure.description + "\n", 9, :italic) if @dossier.procedure.description.present?
add_champs(pdf, @dossier.champs) add_champs(pdf, @dossier.champs)
add_page_numbering(pdf) add_page_numbering(pdf)
add_procedure(pdf, @dossier) add_procedure(pdf, @dossier)

View file

@ -0,0 +1,16 @@
describe 'dossiers/dossier_vide.pdf.prawn', type: :view do
let(:procedure) { create(:procedure, :with_all_champs) }
let(:dossier) { create(:dossier, procedure: procedure) }
before do
assign(:procedure, procedure)
assign(:dossier, dossier)
end
subject { render }
it 'renders a PDF document with empty fields' do
subject
expect(rendered).to be_present
end
end