You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using allow_value in combination with with_message(..., against: ...) and strict, against seems to be getting ignored.
Example:
itdoshould_notallow_value('34:21:92').for(:time).with_message('is not a valid date/time',against: :starts_at).strictend
This will produce an error like:
After setting :time to ‹"34:21:92"›, the matcher expected the FollowUp to be invalid and to raise a validation exception with message "is not a valid date/time". The record was indeed invalid, but the exception message was "Starts at is not a valid date/time" instead.
In order to fix this, I need to say:
itdoshould_notallow_value('34:21:92').for(:time).with_message('Starts at is not a valid date/time').strictend
But this seems to defeat the point of using against.
The text was updated successfully, but these errors were encountered:
When using
allow_value
in combination withwith_message(..., against: ...)
andstrict
,against
seems to be getting ignored.Example:
This will produce an error like:
In order to fix this, I need to say:
But this seems to defeat the point of using
against
.The text was updated successfully, but these errors were encountered: