Pattern: Missing use of have_no_*
/not_to
Issue: -
Enforces use of have_no_*
or not_to
for negated expectations.
# bad
expect(page).to have_no_selector
expect(page).to have_no_css('a')
# good
expect(page).not_to have_selector
expect(page).not_to have_css('a')
# bad
expect(page).not_to have_selector
expect(page).not_to have_css('a')
# good
expect(page).to have_no_selector
expect(page).to have_no_css('a')
Name | Default value | Configurable values |
---|---|---|
EnforcedStyle | not_to |
have_no , not_to |
- [Capybara/NegationMatcher](* https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Capybara/NegationMatcher)