From 25f313da37f7051125bb2a0a8d663e50fd8315fb Mon Sep 17 00:00:00 2001 From: Phil Pirozhkov Date: Thu, 11 Jun 2020 15:00:59 +0300 Subject: [PATCH] Extend list of Rails spec types for DescribeClass There are more: https://github.com/rspec/rspec-rails/blob/56aed229410a8e7a30743d82b8770596fd8c125c/lib/rspec/rails/configuration.rb#L28 --- CHANGELOG.md | 2 ++ lib/rubocop/cop/rspec/describe_class.rb | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0be9fc26d..0cda0d7ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Master (Unreleased) +* Extend the list of Rails spec types for `RSpec/DescribeClass`. ([@pirj][]) + ## 1.40.0 (2020-06-11) * Add new `RSpec/VariableName` cop. ([@tejasbubane][]) diff --git a/lib/rubocop/cop/rspec/describe_class.rb b/lib/rubocop/cop/rspec/describe_class.rb index a2f1aa06c..059689830 100644 --- a/lib/rubocop/cop/rspec/describe_class.rb +++ b/lib/rubocop/cop/rspec/describe_class.rb @@ -43,7 +43,11 @@ class DescribeClass < Cop def_node_matcher :rails_metadata?, <<-PATTERN (pair (sym :type) - (sym {:request :feature :system :routing :view}) + (sym { + :channel :controller :helper :job :mailer :model :request + :routing :view :feature :system :mailbox + } + ) ) PATTERN