Skip to content

Commit

Permalink
Don't omit parentheses
Browse files Browse the repository at this point in the history
  • Loading branch information
akiomik committed Jun 30, 2022
1 parent 2cd3a31 commit 6cd4454
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions spec/rubocop/cop/rspec/rails/have_http_status_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
RSpec.describe RuboCop::Cop::RSpec::Rails::HaveHttpStatus do
it 'registers an offense for `expect(response.status).to be 200`' do
expect_offense(<<~RUBY)
it { expect(response.status).to be 200 }
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer `expect(response).to have_http_status(200)` over `expect(response.status).to be 200`.
it { expect(response.status).to be(200) }
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer `expect(response).to have_http_status(200)` over `expect(response.status).to be(200)`.
RUBY

expect_correction(<<~RUBY)
it { expect(response).to have_http_status 200 }
it { expect(response).to have_http_status(200) }
RUBY
end

Expand All @@ -23,15 +23,15 @@
RUBY
end

it 'does not register an offense for `is_expected.to be 200`' do
it 'does not register an offense for `is_expected.to be(200)`' do
expect_no_offenses(<<~RUBY)
it { is_expected.to be 200 }
it { is_expected.to be(200) }
RUBY
end

it 'does not register an offense for `expect(res.status).to be 200`' do
it 'does not register an offense for `expect(res.status).to be(200)`' do
expect_no_offenses(<<~RUBY)
it { expect(res.status).to be 200 }
it { expect(res.status).to be(200) }
RUBY
end
end

0 comments on commit 6cd4454

Please sign in to comment.