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/matchers
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
..
action_controller Use head instead of render: nothing in tests 2017-09-28 01:08:55 -05:00
active_model Use BigDecimal() over BigDecimal.new 2018-01-02 14:35:41 -02:00
active_record Fix deprecation warning for uniqueness matcher (Rails 4.2) 2018-01-23 23:16:31 -06:00
doublespeak Doublespeak: Remove usage of deprecated RSpec #ordered method 2017-09-17 17:01:50 -05:00
independent Add with_prefix to delegate_method 2014-12-15 22:38:27 -07:00
routing Add a new Routing module 2015-09-25 17:45:33 -06:00
util word_wrap: Add ability to indent wrapped text 2015-12-13 20:22:21 -07:00
doublespeak_spec.rb Make Doublespeak specs runnable without Rails 2015-02-28 23:41:28 -07:00