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:
gregoirenovel 2017-06-28 11:06:07 +02:00 committed by GitHub
commit ff8df96547
2 changed files with 5 additions and 4 deletions

View file

@ -59,7 +59,8 @@ class AttestationTemplate < ApplicationRecord
end end
def dossier_tags def dossier_tags
[{ libelle: 'motivation', description: '', target: 'motivation' }] [{ libelle: 'motivation', description: '', target: 'motivation' },
{ libelle: 'numéro du dossier', description: '', target: 'id' }]
end end
def individual_tags def individual_tags

View file

@ -230,10 +230,10 @@ describe AttestationTemplate, type: :model do
context 'when the dossier has a motivation' do context 'when the dossier has a motivation' do
let(:dossier) { create(:dossier, motivation: 'motivation') } let(:dossier) { create(:dossier, motivation: 'motivation') }
context 'and the title has the motivation tag' do context 'and the title has some dossier tags' do
let(:template_title) { 'title --motivation--' } 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
end end