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
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
..
acceptance Use correct migration class in acceptance tests 2017-09-28 01:09:23 -05:00
support Fix deprecation warning for uniqueness matcher (Rails 4.2) 2018-01-23 23:16:31 -06:00
unit/shoulda/matchers Fix deprecation warning for uniqueness matcher (Rails 4.2) 2018-01-23 23:16:31 -06:00
warnings_spy Be better about looking for warnings on Travis 2014-12-16 20:30:05 -07:00
acceptance_spec_helper.rb Extract a common spec helper 2015-10-07 23:32:51 -06:00
doublespeak_spec_helper.rb Extract a common spec helper 2015-10-07 23:32:51 -06:00
report_warnings.rb Remove all Ruby-emitted warnings 2014-07-18 18:00:08 -06:00
spec_helper.rb Update rspec & rspec-rails to 3.6.x 2017-09-17 17:01:50 -05:00
unit_spec_helper.rb Scope request parameters according to Rails version 2017-09-17 17:46:06 -05:00
warnings_spy.rb Fail build if there are warnings 2015-02-09 10:48:49 -07:00