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