File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed
lib/rubocop/cop/rspec/capybara
spec/rubocop/cop/rspec/capybara Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 2
2
3
3
## Master (Unreleased)
4
4
5
+ * Fix a false positive for ` RSpec/Capybara/SpecificMatcher ` . ([ @ydah ] [ ] )
6
+
5
7
## 2.12.0 (2022-07-02)
6
8
7
9
* Fix incorrect path suggested by ` RSpec/FilePath ` cop when second argument contains spaces. ([ @tejasbubane ] [ ] )
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ def specific_matcher(arg)
56
56
end
57
57
58
58
def acceptable_pattern? ( arg )
59
- arg . match? ( /\[ .+=\w +\] / )
59
+ arg . match? ( /\[ .+=\w +\] / ) || arg . match? ( /[ >,+]/ )
60
60
end
61
61
62
62
def message ( node , matcher )
Original file line number Diff line number Diff line change 77
77
RUBY
78
78
end
79
79
80
+ it 'does not register an offense for abstract matcher when ' \
81
+ 'first argument is element with sub matcher' do
82
+ expect_no_offenses ( <<-RUBY )
83
+ expect(page).to have_css('button body')
84
+ expect(page).to have_css('a,h1')
85
+ expect(page).to have_css('table>tr')
86
+ expect(page).to have_css('select+option')
87
+ RUBY
88
+ end
89
+
80
90
it 'does not register an offense for abstract matcher when ' \
81
91
'first argument is dstr' do
82
92
expect_no_offenses ( <<-'RUBY' )
You can’t perform that action at this time.
0 commit comments