mirror of
https://github.com/thoughtbot/shoulda-matchers.git
synced 2022-11-09 12:01:38 -05:00
38db235515
Rails 6 added the `_scopes: false` option when defining enums. This will prevent rails from creating class scopes for each of the values. Previously, shoulda-matchers checked for the presence of singleton methods as a way to check that the corresponding enum methods have been defined. In rails 6, if someone were using `_scopes: false` the matcher will fail. Instead, we should check on the presence of the instance methods that are generated: `#{value}!` and `#{value}?` as the default checker for the enum values generating methods. We can then check on the scopes/singleton methods generated when using the new `without_scopes` matcher. |
||
---|---|---|
.. | ||
association_matchers | ||
uniqueness | ||
accept_nested_attributes_for_matcher.rb | ||
association_matcher.rb | ||
association_matchers.rb | ||
define_enum_for_matcher.rb | ||
have_attached_matcher.rb | ||
have_db_column_matcher.rb | ||
have_db_index_matcher.rb | ||
have_implicit_order_column.rb | ||
have_readonly_attribute_matcher.rb | ||
have_rich_text_matcher.rb | ||
have_secure_token_matcher.rb | ||
serialize_matcher.rb | ||
uniqueness.rb | ||
validate_uniqueness_of_matcher.rb |