File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
spec/rubocop/cop/rspec/rails Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 3
3
RSpec . describe RuboCop ::Cop ::RSpec ::Rails ::HaveHttpStatus do
4
4
it 'registers an offense for `expect(response.status).to be 200`' do
5
5
expect_offense ( <<~RUBY )
6
- it { expect(response.status).to be 200 }
7
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer `expect(response).to have_http_status(200)` over `expect(response.status).to be 200`.
6
+ it { expect(response.status).to be( 200) }
7
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer `expect(response).to have_http_status(200)` over `expect(response.status).to be( 200) `.
8
8
RUBY
9
9
10
10
expect_correction ( <<~RUBY )
11
- it { expect(response).to have_http_status 200 }
11
+ it { expect(response).to have_http_status( 200) }
12
12
RUBY
13
13
end
14
14
23
23
RUBY
24
24
end
25
25
26
- it 'does not register an offense for `is_expected.to be 200`' do
26
+ it 'does not register an offense for `is_expected.to be( 200) `' do
27
27
expect_no_offenses ( <<~RUBY )
28
- it { is_expected.to be 200 }
28
+ it { is_expected.to be( 200) }
29
29
RUBY
30
30
end
31
31
32
- it 'does not register an offense for `expect(res.status).to be 200`' do
32
+ it 'does not register an offense for `expect(res.status).to be( 200) `' do
33
33
expect_no_offenses ( <<~RUBY )
34
- it { expect(res.status).to be 200 }
34
+ it { expect(res.status).to be( 200) }
35
35
RUBY
36
36
end
37
37
end
You can’t perform that action at this time.
0 commit comments