2
2
3
3
RSpec . describe RuboCop ::Cop ::RSpec ::Capybara ::SpecificMatcher do
4
4
it 'does not register an offense for abstract matcher when ' \
5
- 'first argument is not a replaceable element' do
5
+ 'first argument is not a replaceable element' do
6
6
expect_no_offenses ( <<-RUBY )
7
7
expect(page).to have_selector('article')
8
8
expect(page).to have_no_selector('body')
11
11
end
12
12
13
13
it 'does not register an offense for abstract matcher when ' \
14
- 'first argument is not an element' do
14
+ 'first argument is not an element' do
15
15
expect_no_offenses ( <<-RUBY )
16
16
expect(page).to have_no_css('.a')
17
17
expect(page).to have_selector('#button')
@@ -206,7 +206,7 @@ class style visible obscured exact exact_text normalize_ws match wait
206
206
end
207
207
208
208
it 'registers an offense when using abstract matcher with ' \
209
- 'first argument is element with replaceable pseudo-classes' do
209
+ 'first argument is element with replaceable pseudo-classes' do
210
210
expect_offense ( <<-RUBY )
211
211
expect(page).to have_css('button:not([disabled])', exact_text: 'bar')
212
212
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer `have_button` over `have_css`.
@@ -216,7 +216,7 @@ class style visible obscured exact exact_text normalize_ws match wait
216
216
end
217
217
218
218
it 'registers an offense when using abstract matcher with ' \
219
- 'first argument is element with multiple replaceable pseudo-classes' do
219
+ 'first argument is element with multiple replaceable pseudo-classes' do
220
220
expect_offense ( <<-RUBY )
221
221
expect(page).to have_css('button:not([disabled]):enabled')
222
222
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer `have_button` over `have_css`.
@@ -234,22 +234,22 @@ class style visible obscured exact exact_text normalize_ws match wait
234
234
end
235
235
236
236
it 'does not register an offense when using abstract matcher with ' \
237
- 'first argument is element with replaceable pseudo-classes' \
238
- 'and not boolean attributes' do
237
+ 'first argument is element with replaceable pseudo-classes' \
238
+ 'and not boolean attributes' do
239
239
expect_no_offenses ( <<-RUBY )
240
240
expect(page).to have_css('button:not([name="foo"][disabled])')
241
241
RUBY
242
242
end
243
243
244
244
it 'does not register an offense when using abstract matcher with ' \
245
- 'first argument is element with multiple nonreplaceable pseudo-classes' do
245
+ 'first argument is element with multiple nonreplaceable pseudo-classes' do
246
246
expect_no_offenses ( <<-RUBY )
247
247
expect(page).to have_css('button:first-of-type:not([disabled])')
248
248
RUBY
249
249
end
250
250
251
251
it 'does not register an offense for abstract matcher when ' \
252
- 'first argument is element with nonreplaceable attributes' do
252
+ 'first argument is element with nonreplaceable attributes' do
253
253
expect_no_offenses ( <<-RUBY )
254
254
expect(page).to have_css('button[data-disabled]')
255
255
expect(page).to have_css('button[foo=bar]')
@@ -258,7 +258,7 @@ class style visible obscured exact exact_text normalize_ws match wait
258
258
end
259
259
260
260
it 'does not register an offense for abstract matcher when ' \
261
- 'first argument is element with multiple nonreplaceable attributes' do
261
+ 'first argument is element with multiple nonreplaceable attributes' do
262
262
expect_no_offenses ( <<-RUBY )
263
263
expect(page).to have_css('button[disabled][foo]')
264
264
expect(page).to have_css('button[foo][disabled]')
@@ -269,7 +269,7 @@ class style visible obscured exact exact_text normalize_ws match wait
269
269
end
270
270
271
271
it 'does not register an offense for abstract matcher when ' \
272
- 'first argument is element with sub matcher' do
272
+ 'first argument is element with sub matcher' do
273
273
expect_no_offenses ( <<-RUBY )
274
274
expect(page).to have_css('button body')
275
275
expect(page).to have_css('a,h1')
@@ -279,7 +279,7 @@ class style visible obscured exact exact_text normalize_ws match wait
279
279
end
280
280
281
281
it 'does not register an offense for abstract matcher when ' \
282
- 'first argument is dstr' do
282
+ 'first argument is dstr' do
283
283
expect_no_offenses ( <<-'RUBY' )
284
284
expect(page).to have_css(%{a[href="#{foo}"]}, text: "bar")
285
285
RUBY
0 commit comments