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: with_high_message expects a custom validation message too #1623

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

freesteph
Copy link

The only impact being in the generated documentation (via description_clauses_for_qualifiers):

before:

is expected to validate that Y lies inside the range R

after

is expected to validate that X lies inside the range R producing a
custom validation error on failure

As with_low_message already does.

The only impact being in the generated documentation (via
description_clauses_for_qualifiers):

before:

> is expected to validate that Y lies inside the range R

after

> is expected to validate that X lies inside the range R producing a
custom validation error on failure

As with_low_message already does.
Copy link
Collaborator

@matsales28 matsales28 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mind adding a spec to cover this case?

I think you can do something similar to the one on spec/unit/shoulda/matchers/active_model/validate_numericaly_of_spec.rb

it 'describes that it relies upon a strict validation' do
matcher = validate_numericality_of(:attr).strict
expect(matcher.description).to eq(
'validate that :attr looks like a number, raising a validation exception on failure',
)
end

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.

None yet

2 participants