Merge pull request #10318 from mfo/US/better-error-messages

ETQ Usager, je souhaite avoir des messages d'erreur homogènes et comprehensibles
This commit is contained in:
mfo 2024-04-12 11:55:39 +00:00 committed by GitHub
commit f1935eb7a0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 16 additions and 11 deletions

View file

@ -20,7 +20,7 @@ describe Champs::DecimalNumberChamp do
it 'is not valid and contains expected error' do
expect(subject).to be_falsey
expect(champ.errors[:value]).to eq(["« #{champ.libelle} » doit comprendre maximum 3 chiffres après la virgule", "« #{champ.libelle} » n'est pas un nombre"])
expect(champ.errors[:value]).to eq(["doit comprendre maximum 3 chiffres après la virgule", "n'est pas un nombre"])
end
end
@ -29,7 +29,7 @@ describe Champs::DecimalNumberChamp do
it 'is not valid and contains expected error' do
expect(subject).to be_falsey
expect(champ.errors[:value]).to eq(["« #{champ.libelle} » doit comprendre maximum 3 chiffres après la virgule"])
expect(champ.errors[:value]).to eq(["doit comprendre maximum 3 chiffres après la virgule"])
end
end

View file

@ -14,7 +14,7 @@ describe Champs::IntegerNumberChamp do
it 'is not valid and contains errors' do
is_expected.to be_falsey
expect(champ.errors[:value]).to eq(["« #{champ.libelle} » doit être un nombre entier (sans chiffres après la virgule)"])
expect(champ.errors[:value]).to eq(["doit être un nombre entier (sans chiffres après la virgule)"])
end
end
@ -23,7 +23,7 @@ describe Champs::IntegerNumberChamp do
it 'is not valid and contains errors' do
is_expected.to be_falsey
expect(champ.errors[:value]).to eq(["« #{champ.libelle} » doit être un nombre entier (sans chiffres après la virgule)"])
expect(champ.errors[:value]).to eq(["doit être un nombre entier (sans chiffres après la virgule)"])
end
end