Merge pull request #9799 from demarches-simplifiees/9782-format-motivation

ETQ instructeur, lorsque je motive une décision, la motivation est désormais bien formatée
This commit is contained in:
krichtof 2023-12-05 22:28:14 +00:00 committed by GitHub
commit 505bdca11a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -3,6 +3,7 @@ module TagsSubstitutionConcern
include Rails.application.routes.url_helpers
include ActionView::Helpers::UrlHelper
include ActionView::Helpers::TextHelper
module TagsParser
include Parsby::Combinators
@ -64,7 +65,7 @@ module TagsSubstitutionConcern
id: 'dossier_motivation',
libelle: 'motivation',
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
},
{

View file

@ -240,7 +240,7 @@ describe TagsSubstitutionConcern, type: :model do
context 'and the template has some dossier tags' do
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