Skip to content

Commit

Permalink
Configure Capybara/ClickLinkOrButtonStyle
Browse files Browse the repository at this point in the history
This rule's default enforce style, `link_or_button` [1], introduced a
number of problems [2]. Specifically, I noticed issues switching to
`click_on` from `click_button` [3]. The hack solution is to ignore or
disable the rule in some places but not in others. Not great.

As a result, the rule is slated for removal [4] and replacement [5] by
a new rule. In the interim, configuring this rule to enforce a strict
use of `click_button` and `click_link` is preferential (and, honestly,
more communicative).

In this author's opinion, user interface specs should be explicit about
the markup under test.

[1] https://docs.rubocop.org/rubocop-capybara/cops_capybara.html#capybaraclicklinkorbuttonstyle
[2] rubocop/rubocop-capybara#61
[3] rubocop/rubocop-capybara#61 (comment)
[4] rubocop/rubocop-capybara#81
[5] rubocop/rubocop-capybara#99
  • Loading branch information
jgarber623-cargosense committed May 6, 2024
1 parent b6a9e33 commit d368a64
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions config/rubocop-capybara.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@
# @see https://github.com/rubocop/rubocop-capybara

require: rubocop-capybara

Capybara/ClickLinkOrButtonStyle:
EnforcedStyle: strict

0 comments on commit d368a64

Please sign in to comment.