1
0
Fork 0
mirror of https://github.com/thoughtbot/shoulda-matchers.git synced 2022-11-09 12:01:38 -05:00
thoughtbot--shoulda-matchers/spec/unit/shoulda
Elliot Winkler 9103ead214 Fix deprecation warning for uniqueness matcher (Rails 4.2)
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.
2018-01-23 23:16:31 -06:00
..
matchers Fix deprecation warning for uniqueness matcher (Rails 4.2) 2018-01-23 23:16:31 -06:00