Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rspec run fail when using custom error message #85

Conversation

luuqnhu
Copy link

@luuqnhu luuqnhu commented Aug 3, 2022

There's a bug appears in spec for validate_email_format_of when using custom error message:

validates :email,  email_format: { message: "Invalid email format. Please try again." }

spec:

it { is_expected.to validate_email_format_of(:email).with_message("Invalid email format. Please try again.") }

Error:

Failure/Error:
it { is_expected.to validate_email_format_of(:email).with_message("Invalid email format. Please try again.") } 
expected #<JobMatcher::Candidate id: nil, email: "invalid@example.", ...> 
to validate email format of :email with message "Invalid email format. Please try again."

@alexdunae alexdunae merged commit d78a5e7 into validates-email-format-of:master Aug 3, 2022
@alexdunae
Copy link
Contributor

Fantastic - thanks for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants