bug(tags): libelle with double dash, double dash also known as tag delimiter

This commit is contained in:
Martin 2024-02-16 10:32:44 +01:00 committed by mfo
parent 0b3a0d5840
commit 0fbbe4d97c

View file

@ -203,6 +203,28 @@ describe TagsSubstitutionConcern, type: :model do
end
end
context 'when the procedure has a type de champ with double dash (--)' do
let(:types_de_champ_public) do
[
{ libelle: "bon pote -- c'est top" }
]
end
context 'and they are used in the template' do
let(:template) { "--bon pote -- c'est top--" }
context 'and their value in the dossier are not nil' do
before do
dossier.champs_public
.find { |champ| champ.libelle == "bon pote -- c'est top" }
.update(value: 'ceci est mon évènement')
end
it { is_expected.to eq('ceci est mon évènement') }
end
end
end
context 'when the procedure has a type de champ repetition' do
let(:template) { '--Répétition--' }
let(:types_de_champ_public) { [{ type: :repetition, libelle: 'Répétition', mandatory: true, children: [{ libelle: 'Nom' }, { libelle: 'Prénom' }] }] }