fix(dossier): tag can contain non breaking space

This commit is contained in:
Paul Chavard 2022-10-21 16:19:08 +02:00
parent d7c5dcf8bb
commit f2e8dba8e4
3 changed files with 11 additions and 2 deletions

View file

@ -519,5 +519,14 @@ describe TagsSubstitutionConcern, type: :model do
{ tag: "numéro-du - dossier" }
])
end
it 'normalize white spaces' do
tokens = TagsSubstitutionConcern::TagsParser.parse("hello --Jour(s) fixe(s)\xc2\xA0souhaité(s)\xc2\xA0:-- world".encode('utf-8'))
expect(tokens).to eq([
{ text: "hello " },
{ tag: "Jour(s) fixe(s) souhaité(s) :" },
{ text: " world" }
])
end
end
end