thoughtbot--shoulda-matchers/lib/shoulda/matchers/active_record
John DeWyze 38db235515
Add `without_scopes` to enum matcher. (#1453)
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.
2022-01-31 20:26:50 -03:00
..
association_matchers Remove unnecessary conditions for rails 5.0 (#1426) 2021-03-23 14:06:23 -03:00
uniqueness fix(rubocop): Fix Style, Layout, Lint and other offenses [ci skip] 2020-11-03 10:05:25 -07:00
accept_nested_attributes_for_matcher.rb fix(rubocop): Fix Layout/LineLength 2020-11-03 10:05:25 -07:00
association_matcher.rb Add Appraisal for Rails 6.1 (#1418) 2021-06-03 17:41:27 -03:00
association_matchers.rb Revert "Use autoloading instead of requiring all files up front" 2020-08-26 10:52:54 -06:00
define_enum_for_matcher.rb Add `without_scopes` to enum matcher. (#1453) 2022-01-31 20:26:50 -03:00
have_attached_matcher.rb fix(rubocop): Fix Style, Layout, Lint and other offenses [ci skip] 2020-11-03 10:05:25 -07:00
have_db_column_matcher.rb Add array option support for have db column matcher (#1465) 2021-12-15 14:21:36 -03:00
have_db_index_matcher.rb fix(rubocop): Fix Layout/LineLength 2020-11-03 10:05:25 -07:00
have_implicit_order_column.rb fix(rubocop): Fix Style, Layout, Lint and other offenses [ci skip] 2020-11-03 10:05:25 -07:00
have_readonly_attribute_matcher.rb fix(rubocop): Fix Layout/LineLength 2020-11-03 10:05:25 -07:00
have_rich_text_matcher.rb fix(rubocop): Fix Layout/LineLength 2020-11-03 10:05:25 -07:00
have_secure_token_matcher.rb fix(rubocop): Fix Layout related offenses [ci skip] 2020-11-03 10:05:25 -07:00
serialize_matcher.rb fix(rubocop): Fix Layout/LineLength 2020-11-03 10:05:25 -07:00
uniqueness.rb Fix module 2020-11-06 11:00:43 -07:00
validate_uniqueness_of_matcher.rb fix(rubocop): Fix Layout/LineLength 2020-11-03 10:05:25 -07:00