Skip to content

Commit 6cd4454

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

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

spec/rubocop/cop/rspec/rails/have_http_status_spec.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
RSpec.describe RuboCop::Cop::RSpec::Rails::HaveHttpStatus do
44
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

@@ -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)