Class: RuboCop::Cop::Sevencop::RSpecRailsHaveHttpStatus
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Sevencop::RSpecRailsHaveHttpStatus
- Defined in:
- lib/rubocop/cop/sevencop/rspec_rails_have_http_status.rb
Overview
Always check status code with ‘have_http_status`.
Constant Summary collapse
- MSG =
'Always check status code with `have_http_status`.'
- EXAMPLE_METHOD_NAMES =
%i[ example it specify ].to_set.freeze
- STATUS_CHECK_METHOD_NAMES =
%i[ have_http_status redirect_to ].to_set.freeze
Instance Method Summary collapse
Instance Method Details
#on_block(node) ⇒ void
This method returns an undefined value.
41 42 43 44 45 46 |
# File 'lib/rubocop/cop/sevencop/rspec_rails_have_http_status.rb', line 41 def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler return unless example_method?(node) return if including_status_check_method?(node) add_offense(node) end |