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:
commit
f1935eb7a0
7 changed files with 16 additions and 11 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue