[#1110] Port libellé procédure tag from mail templates
This commit is contained in:
parent
ee109b24e3
commit
ad0462f7ff
2 changed files with 8 additions and 0 deletions
|
@ -25,6 +25,7 @@ module TagsSubstitutionConcern
|
|||
{ libelle: 'date de décision',
|
||||
description: 'Date de la décision d’acceptation, refus, ou classement sans suite',
|
||||
lambda: -> (d) { d.processed_at.present? ? d.processed_at.localtime.strftime('%d/%m/%Y') : '' } },
|
||||
{ libelle: 'libellé procédure', description: '', lambda: -> (d) { d.procedure.libelle } },
|
||||
{ libelle: 'numéro du dossier', description: '', target: :id }]
|
||||
end
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ describe TagsSubstitutionConcern, type: :model do
|
|||
|
||||
let(:procedure) do
|
||||
create(:procedure,
|
||||
libelle: 'Une magnifique procédure',
|
||||
types_de_champ: types_de_champ,
|
||||
types_de_champ_private: types_de_champ_private,
|
||||
for_individual: for_individual)
|
||||
|
@ -172,6 +173,12 @@ describe TagsSubstitutionConcern, type: :model do
|
|||
it { is_expected.to eq(DateTime.now.localtime.strftime('%d/%m/%Y')) }
|
||||
end
|
||||
|
||||
context "when the template has a libellé procédure tag" do
|
||||
let(:template) { 'body --libellé procédure--' }
|
||||
|
||||
it { is_expected.to eq('body Une magnifique procédure') }
|
||||
end
|
||||
|
||||
context "match breaking and non breaking spaces" do
|
||||
before { dossier.champs.first.update_attributes(value: 'valeur') }
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue