File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed
Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ Pattern: Negation matcher after ` visit `
2+
3+ Issue: -
4+
5+ ## Description
6+
7+ Do not allow negative matchers to be used immediately after ` visit ` .
8+
9+ ## Examples
10+
11+ ``` ruby
12+ # bad
13+ visit foo_path
14+ expect(page).to have_no_link(' bar' )
15+ expect(page).to have_css(' a' )
16+
17+ # good
18+ visit foo_path
19+ expect(page).to have_css(' a' )
20+ expect(page).to have_no_link(' bar' )
21+
22+ # bad
23+ visit foo_path
24+ expect(page).not_to have_link(' bar' )
25+ expect(page).to have_css(' a' )
26+
27+ # good
28+ visit foo_path
29+ expect(page).to have_css(' a' )
30+ expect(page).not_to have_link(' bar' )
31+ ```
32+
33+ ## Further Reading
34+
35+ * [ RuboCop - Capybara/NegationMatcherAfterVisit] ( https://docs.rubocop.org/rubocop-capybara/cops_capybara.html#capybaranegationmatcheraftervisit )
36+
You can’t perform that action at this time.
0 commit comments