Skip to content

Commit eb40985

Browse files
committed
Don't omit parentheses
1 parent 2cd3a31 commit eb40985

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
# frozen_string_literal: true
22

33
RSpec.describe RuboCop::Cop::RSpec::Rails::HaveHttpStatus do
4-
it 'registers an offense for `expect(response.status).to be 200`' do
4+
it 'registers an offense for `expect(response.status).to be(200)`' do
55
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)`.
88
RUBY
99

1010
expect_correction(<<~RUBY)
11-
it { expect(response).to have_http_status 200 }
11+
it { expect(response).to have_http_status(200) }
1212
RUBY
1313
end
1414

15-
it 'registers an offense for `expect(response.status).not_to eq 404`' do
15+
it 'registers an offense for `expect(response.status).not_to eq(404)`' do
1616
expect_offense(<<~RUBY)
1717
it { expect(response.status).not_to eq(404) }
1818
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer `expect(response).not_to have_http_status(404)` over `expect(response.status).not_to eq(404)`.
@@ -23,15 +23,15 @@
2323
RUBY
2424
end
2525

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
2727
expect_no_offenses(<<~RUBY)
28-
it { is_expected.to be 200 }
28+
it { is_expected.to be(200) }
2929
RUBY
3030
end
3131

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
3333
expect_no_offenses(<<~RUBY)
34-
it { expect(res.status).to be 200 }
34+
it { expect(res.status).to be(200) }
3535
RUBY
3636
end
3737
end

0 commit comments

Comments
 (0)