mirror of
https://github.com/thoughtbot/shoulda-matchers.git
synced 2022-11-09 12:01:38 -05:00
9103ead214
The uniqueness matcher needs to set the attributes under test (which is not only the attribute you give to the matcher, but also any scope attributes as well) to arbitrary values so that it can test the underlying uniqueness validation logic. To set an attribute correctly, it needs to check what type of column that attribute is and then generate a value that matches the column (otherwise unpredictable results happen). The matcher was doing this for scope attributes, but not for the main attribute. One of the consequences of this inconsistency is that when setting a boolean attribute, it was using a string value, which generates a warning under Rails 4.2. This commit fixes this so that the main attribute is set the same way as scope attributes, thereby removing the warning. |
||
---|---|---|
.. | ||
matchers |