Class: RuboCop::Cop::Capybara::AmbiguousClick
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Capybara::AmbiguousClick
- Defined in:
- lib/rubocop/cop/capybara/ambiguous_click.rb
Overview
Specify the exact target to click on.
In projects where accessibility needs to be considered, it is crucial to specify the click target precisely.
Constant Summary collapse
- MSG =
'Use `click_link` or `click_button` instead of `%<method>s`.'
- RESTRICT_ON_SEND =
%i[click_link_or_button click_on].freeze
Instance Method Summary collapse
Instance Method Details
permalink #on_send(node) ⇒ Object
[View source]
24 25 26 |
# File 'lib/rubocop/cop/capybara/ambiguous_click.rb', line 24 def on_send(node) add_offense(node, message: format(MSG, method: node.method_name)) end |