diff --git a/CHANGELOG.md b/CHANGELOG.md index f65e661fc..6cc79a3c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ * Add new `RSpec/IdenticalEqualityAssertion` cop. ([@tejasbubane][]) * Add `RSpec/Rails/AvoidSetupHook` cop. ([@paydaylight][]) * Fix false negative in `RSpec/ExpectChange` cop with block style and chained method call. ([@tejasbubane][]) +* Fix `Include` configuration for sub-departments. ([@pirj][]) ## 2.3.0 (2021-04-28) diff --git a/config/default.yml b/config/default.yml index fe526a173..39ca129bf 100644 --- a/config/default.yml +++ b/config/default.yml @@ -1,5 +1,5 @@ --- -RSpec: +RSpec: &rspec Enabled: true Include: - "**/*_spec.rb" @@ -698,6 +698,9 @@ RSpec/Yield: VersionAdded: '1.32' StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Yield +RSpec/Capybara: + <<: *rspec + RSpec/Capybara/CurrentPathExpectation: Description: Checks that no expectations are set on Capybara's `current_path`. Enabled: true @@ -720,6 +723,9 @@ RSpec/Capybara/VisibilityMatcher: VersionChanged: '2.0' StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Capybara/VisibilityMatcher +RSpec/FactoryBot: + <<: *rspec + RSpec/FactoryBot/AttributeDefinedStatically: Description: Always declare attribute values as blocks. Enabled: true @@ -759,6 +765,11 @@ RSpec/FactoryBot/FactoryClassName: VersionChanged: '2.0' StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/FactoryClassName +RSpec/Rails: + Include: + - "**/*_spec.rb" + - "**/spec/**/*" + RSpec/Rails/AvoidSetupHook: Description: Checks that tests use RSpec `before` hook over Rails `setup` method. Enabled: pending diff --git a/spec/project/default_config_spec.rb b/spec/project/default_config_spec.rb index 2a349f881..e5414e0f2 100644 --- a/spec/project/default_config_spec.rb +++ b/spec/project/default_config_spec.rb @@ -29,7 +29,7 @@ end let(:config_keys) do - cop_names + %w[RSpec] + cop_names + %w[RSpec RSpec/Capybara RSpec/FactoryBot RSpec/Rails] end def cop_configuration(config_key)