ackama / rails-template

Application template for Rails 7 projects; preloaded with best practices for TDD, security, deployment, and developer productivity.
Other
294 stars 15 forks source link

fix: use `click_on` rather than `click_link` and `click_button` #523

Closed G-Rath closed 7 months ago

G-Rath commented 7 months ago

https://github.com/rubocop/rubocop-capybara/pull/76 changed the default to enforce using the more generic click_link_or_button and click_on because

These methods offer a weaker coupling between the test and HTML, allowing for a more faithful reflection of how the user behaves.

Which is very fair imo and inline with other testing frameworks like testing-library.