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 is not safe for autocorrect. #96

Closed jcoyne closed 6 months ago

jcoyne commented 6 months ago

I have a file called spec/models/page_spec.rb It does not use capybara.

It has this line:

expect(page).not_to have_content

and rubocop-capybara autocorrects this to:

expect(page).to have_no_content

This now causes my test to fail because the page object (which has nothing to do with Capybara) does not respond to a method called has_no_content?