thoughtbot--shoulda-matchers/lib/shoulda/matchers/active_record
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
..
association_matchers Improve messaging of .required and .optional 2019-02-14 17:48:26 -07:00
uniqueness Documentation updates 2014-12-25 01:13:30 -05:00
accept_nested_attributes_for_matcher.rb Update RSpec test style across docs 2016-06-15 18:02:07 -06:00
association_matcher.rb Fix default behavior of belong_to under Rails 4.2 2018-09-16 12:21:41 -06:00
association_matchers.rb Extract examples in README to inline documentation 2014-06-20 16:41:27 -06:00
define_enum_for_matcher.rb Add with_prefix and with_suffix to define_enum_for 2018-01-28 00:47:56 -06:00
have_db_column_matcher.rb Update RSpec test style across docs 2016-06-15 18:02:07 -06:00
have_db_index_matcher.rb Fix typo (#1119) 2018-08-10 14:36:12 +01:00
have_readonly_attribute_matcher.rb Update RSpec test style across docs 2016-06-15 18:02:07 -06:00
have_secure_token_matcher.rb Add matcher for has_secure_token 2017-10-15 21:07:58 -04:00
serialize_matcher.rb Update RSpec test style across docs 2016-06-15 18:02:07 -06:00
uniqueness.rb Move uniqueness validation to ActiveRecord module 2014-12-13 17:53:16 -05:00
validate_uniqueness_of_matcher.rb Fixes uniqueness validator syntax in documentation (#1172) 2019-02-03 22:58:05 -07:00