Class: RuboCop::Cop::TurboRspec::UseHaveTurboStream
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::TurboRspec::UseHaveTurboStream
- Defined in:
- lib/rubocop/cop/turbo_rspec/use_have_turbo_stream.rb
Overview
Flags request specs that assert turbo stream content by matching against +response.body+ as a raw string. Use +have_turbo_stream+ instead.
Constant Summary collapse
- MSG =
"Use `expect(response).to have_turbo_stream` instead of " \ "asserting on `response.body` directly."
- RESTRICT_ON_SEND =
%i[to not_to].freeze
Instance Method Summary collapse
Instance Method Details
#on_send(node) ⇒ Object
31 32 33 34 35 36 |
# File 'lib/rubocop/cop/turbo_rspec/use_have_turbo_stream.rb', line 31 def on_send(node) return unless response_body_expectation?(node) return unless (node) add_offense(node) end |