fix format for motivation in notification mail

This commit is contained in:
Christophe Robillard 2023-12-05 18:04:44 +01:00
parent 189b9e5037
commit 961c7c5be4
2 changed files with 3 additions and 2 deletions

View file

@ -3,6 +3,7 @@ module TagsSubstitutionConcern
include Rails.application.routes.url_helpers include Rails.application.routes.url_helpers
include ActionView::Helpers::UrlHelper include ActionView::Helpers::UrlHelper
include ActionView::Helpers::TextHelper
module TagsParser module TagsParser
include Parsby::Combinators include Parsby::Combinators
@ -64,7 +65,7 @@ module TagsSubstitutionConcern
id: 'dossier_motivation', id: 'dossier_motivation',
libelle: 'motivation', libelle: 'motivation',
description: 'Motivation facultative associée à la décision finale dacceptation, refus ou classement sans suite', description: 'Motivation facultative associée à la décision finale dacceptation, refus ou classement sans suite',
target: :motivation, lambda: -> (d) { simple_format(d.motivation) },
available_for_states: Dossier::TERMINE available_for_states: Dossier::TERMINE
}, },
{ {

View file

@ -240,7 +240,7 @@ describe TagsSubstitutionConcern, type: :model do
context 'and the template has some dossier tags' do context 'and the template has some dossier tags' do
let(:template) { '--motivation-- --numéro du dossier--' } let(:template) { '--motivation-- --numéro du dossier--' }
it { is_expected.to eq("motivation #{dossier.id}") } it { is_expected.to eq("<p>motivation</p> #{dossier.id}") }
end end
end end