adjust error message
This commit is contained in:
@@ -75,7 +75,7 @@ module Params
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
raise_error(message || "#{key} must follow the email format")
|
raise_error(message || "#{key} must follow the email format: '#{params[key]}'")
|
||||||
end
|
end
|
||||||
|
|
||||||
def unique_value(params, key, message: nil)
|
def unique_value(params, key, message: nil)
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ RSpec.describe Params::BaseValidator do
|
|||||||
emails.each do |email|
|
emails.each do |email|
|
||||||
expect do
|
expect do
|
||||||
validator.email_format({ email: }, :email)
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -97,7 +97,7 @@ RSpec.describe Params::BaseValidator do
|
|||||||
emails.each do |email|
|
emails.each do |email|
|
||||||
expect do
|
expect do
|
||||||
validator.email_format({ email: }, :email)
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user