Merge pull request #510 from sgmap/add_dossier_id_to_attestation
[FIX 509] add dossier id tag in attestation template
This commit is contained in:
commit
ff8df96547
2 changed files with 5 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue