Merge pull request #10009 from mfo/US/tag-with-double-dash
correctif(tags): ETQ admin, les champs contenant deux '-' successif ne pouvaient etre utilisé dans les attestations & mail
This commit is contained in:
commit
7fb8e2e967
2 changed files with 23 additions and 0 deletions
|
@ -19,6 +19,7 @@ module TagsSubstitutionConcern
|
|||
.sub(/[[:space:]]+$/, '')
|
||||
.gsub(/[[:space:]]/, ' ')
|
||||
.gsub(' ', ' ')
|
||||
.gsub(/--/, '__')
|
||||
end
|
||||
|
||||
define_combinator :doc do
|
||||
|
|
|
@ -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' }] }] }
|
||||
|
|
Loading…
Add table
Reference in a new issue