thoughtbot--shoulda-matchers/lib/shoulda/matchers/active_record/association_matchers
Elliot Winkler ca6a1ff9ee Improve messaging of .required and .optional
When the `required` and `optional` qualifiers on `belong_to` fail, the
message can be a little confusing. There are actually two ways to
satisfy both qualifiers. One way, of course, is to match the option on
the association with the qualifier itself, so if the association is
defined with `required: true`, that will match
`belong_to(...).required`, and if it's `required: false`, that will
match `belong_to(...).required(false)` (and similar for `optional`). The
second way, though, is to manually add a presence validation to the
association (this will obviously only match `required(true)`). We need
to update the failure message to reflect these cases.
2019-02-14 17:48:26 -07:00
..
counter_cache_matcher.rb Prefer protected over private attributes 2014-06-27 14:41:54 -06:00
dependent_matcher.rb Dependent qualifier now supports more values 2015-01-20 14:10:14 -07:00
inverse_of_matcher.rb Prefer protected over private attributes 2014-06-27 14:41:54 -06:00
join_table_matcher.rb Fix #tables deprecation in Rails 5.0 and keep compatibility with Rails 4.x 2017-09-17 17:01:50 -05:00
model_reflection.rb Rename AssociationMatcher#join_table 2015-04-03 23:33:19 -06:00
model_reflector.rb Rename AssociationMatcher#join_table 2015-04-03 23:33:19 -06:00
option_verifier.rb Rails 5: Fix failing association matcher tests 2017-09-17 17:01:50 -05:00
optional_matcher.rb Improve messaging of .required and .optional 2019-02-14 17:48:26 -07:00
order_matcher.rb Prefer protected over private attributes 2014-06-27 14:41:54 -06:00
required_matcher.rb Improve messaging of .required and .optional 2019-02-14 17:48:26 -07:00
source_matcher.rb Prefer protected over private attributes 2014-06-27 14:41:54 -06:00
through_matcher.rb Prefer protected over private attributes 2014-06-27 14:41:54 -06:00