Skip to content

Files

Latest commit

 

History

History
44 lines (30 loc) · 921 Bytes

RSpec-Capybara-NegationMatcher.md

File metadata and controls

44 lines (30 loc) · 921 Bytes

Pattern: Missing use of have_no_*/not_to

Issue: -

Description

Enforces use of have_no_* or not_to for negated expectations.

Examples

EnforcedStyle: not_to (default)

# 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')

EnforcedStyle: have_no

# 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')

Configurable attributes

Name Default value Configurable values
EnforcedStyle not_to have_no, not_to

Further Reading