rubocop / rubocop-capybara

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

Capybara/NegationMatcher: False negative with to_not #90

Closed franzliedke closed 6 months ago

franzliedke commented 6 months ago

I get an offense when using not_to:

spec/system/some_spec.rb:229:24: C: [Correctable] Capybara/NegationMatcher: Use expect(...).to have_no_css.
          expect(page).not_to have_css(".some-class")
                       ^^^^^^^^^^^^^^^

But not when the same code uses to_not. I guess the code assumes the default config for the NotToNot cop, but that isn't the case everywhere. 🤓