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
I've run into a fairly unique situation, but I thought I'd bring it up in case someone wants to defend against it.
If your factory for generating objects uses a string that does not have change with swapcase (i.e. something like '%-1-%'), and you're doing a validate_uniqueness_of test without specifying case_insensitive, then you will get a rather confusing error message.
I've run into a fairly unique situation, but I thought I'd bring it up in case someone wants to defend against it.
If your factory for generating objects uses a string that does not have change with
swapcase
(i.e. something like'%-1-%'
), and you're doing avalidate_uniqueness_of
test without specifyingcase_insensitive
, then you will get a rather confusing error message.Perhaps it might make sense somewhere around https://github.com/thoughtbot/shoulda-matchers/blob/master/lib/shoulda/matchers/active_record/validate_uniqueness_of_matcher.rb#L410 to check to see that the swapcased value differs from the original value and if it doesn't to throw an error along the lines of, "if you're not doing a case_insensitive test, then you need to make sure your value here has alpha characters in it!".
The text was updated successfully, but these errors were encountered: