Class: RuboCop::Cop::Capybara::RSpec::HaveSelector
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Capybara::RSpec::HaveSelector
- Extended by:
- AutoCorrector
- Includes:
- RangeHelp
- Defined in:
- lib/rubocop/cop/capybara/rspec/have_selector.rb
Overview
Use ‘have_css` or `have_xpath` instead of `have_selector`.
Constant Summary collapse
- MSG =
'Use `%<good>s` instead of `have_selector`.'
- RESTRICT_ON_SEND =
%i[have_selector].freeze
- SELECTORS =
%i[css xpath].freeze
Instance Method Summary collapse
Instance Method Details
#on_send(node) ⇒ Object
44 45 46 47 48 |
# File 'lib/rubocop/cop/capybara/rspec/have_selector.rb', line 44 def on_send(node) argument = node.first_argument on_select_with_type(node, argument) if argument.sym_type? on_select_without_type(node) if %i[str dstr].include?(argument.type) end |