[FIX #509] add dossier id tag in attestation template

This commit is contained in:
Simon Lehericey 2017-06-28 10:51:46 +02:00
parent 545b28c2c0
commit ee415c4aa6
2 changed files with 5 additions and 4 deletions

View file

@ -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

View file

@ -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