rubocop / rubocop-capybara

Code style checking for Capybara files.
https://docs.rubocop.org/rubocop-capybara
MIT License
40 stars 8 forks source link

Misunderstanding with Capybara/NegationMatcher #57

Closed ydakuka closed 7 months ago

ydakuka commented 1 year ago

Actual behavior

The default behavior of the rubocop-capybara is inconsistent with the rspec style guide.

Reference 1: https://rspec.rubystyle.guide/#capybara-negative-selectors Reference 2: https://docs.rubocop.org/rubocop-capybara/cops_capybara.html#capybaranegationmatcher

Expected behavior

The rspec style guide will be corrected.

mvz commented 7 months ago

@ydah how up-to-date is the rspec style guide really? That rule may stem from a time when not_to have.. would not invoke Capybara's timeout logic.

pirj commented 7 months ago

@mvz it might be significantly outdated. I maintain it, but I’m not an expert in Capybara, so most of Capybara-related guidelines are inherited from older guides. I appreciate if you could contribute and update the guide.

ydah commented 7 months ago

Maybe we should extract factory_bot and capybara guidelines from rspec-style-guide?

pirj commented 7 months ago

There are not enough guidelines for Capybara/FB now. But if someone is up to create such a guide, I’d be happy to move existing guidelines there.