adjust error message

This commit is contained in:
Pete Matsyburka
2024-10-22 17:59:08 +03:00
parent 3f03d343ca
commit babaf1aa48
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -75,7 +75,7 @@ module Params
return
end
raise_error(message || "#{key} must follow the email format")
raise_error(message || "#{key} must follow the email format: '#{params[key]}'")
end
def unique_value(params, key, message: nil)
+2 -2
View File
@@ -42,7 +42,7 @@ RSpec.describe Params::BaseValidator do
emails.each do |email|
expect do
validator.email_format({ email: }, :email)
end.to raise_error(described_class::InvalidParameterError, 'email must follow the email format')
end.to raise_error(described_class::InvalidParameterError, "email must follow the email format: '#{email}'")
end
end
@@ -97,7 +97,7 @@ RSpec.describe Params::BaseValidator do
emails.each do |email|
expect do
validator.email_format({ email: }, :email)
end.to raise_error(described_class::InvalidParameterError, 'email must follow the email format')
end.to raise_error(described_class::InvalidParameterError, "email must follow the email format: '#{email}'")
end
end