-
-
Notifications
You must be signed in to change notification settings - Fork 909
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Uniqueness: Fix default behavior for case-insensitive models
If you have a model that has a uniqueness validation using `case_sensitive: false`, and you are testing against but do not qualify the matcher with `case_insensitive`, then the matcher will pass unexpectedly. Take this model for instance: class Product < ActiveRecord::Base validates_uniqueness_of :name, case_sensitive: false end Currently, the following test passes. With this commit, it will now (correctly) fail: describe Product do it { is_expected.to validate_uniqueness_of(:name) } end
- Loading branch information
Showing
2 changed files
with
43 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters