diff --git a/app/models/attestation_template.rb b/app/models/attestation_template.rb index 9c2b5ad49..3e84c0108 100644 --- a/app/models/attestation_template.rb +++ b/app/models/attestation_template.rb @@ -59,7 +59,8 @@ class AttestationTemplate < ApplicationRecord end def dossier_tags - [{ libelle: 'motivation', description: '', target: 'motivation' }] + [{ libelle: 'motivation', description: '', target: 'motivation' }, + { libelle: 'numéro du dossier', description: '', target: 'id' }] end def individual_tags diff --git a/spec/models/attestation_template_spec.rb b/spec/models/attestation_template_spec.rb index 95270dbb9..6d7dffb7c 100644 --- a/spec/models/attestation_template_spec.rb +++ b/spec/models/attestation_template_spec.rb @@ -230,10 +230,10 @@ describe AttestationTemplate, type: :model do context 'when the dossier has a motivation' do let(:dossier) { create(:dossier, motivation: 'motivation') } - context 'and the title has the motivation tag' do - let(:template_title) { 'title --motivation--' } + context 'and the title has some dossier tags' do + let(:template_title) { 'title --motivation-- --numéro du dossier--' } - it { expect(view_args[:title]).to eq('title motivation') } + it { expect(view_args[:title]).to eq("title motivation #{dossier.id}") } end end