Fixes RSpec Rails HaveHttpStatus cop in services & support

This commit is contained in:
cyrillefr
2025-05-14 11:08:43 +02:00
parent 8135aeaeda
commit 7f842d77ea
3 changed files with 2 additions and 11 deletions

View File

@@ -221,15 +221,6 @@ Metrics/PerceivedComplexity:
- 'app/models/spree/ability.rb'
- 'app/models/spree/order/checkout.rb'
# Offense count: 28
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: ResponseMethods.
# ResponseMethods: response, last_response
RSpecRails/HaveHttpStatus:
Exclude:
- 'spec/services/embedded_page_service_spec.rb'
- 'spec/support/api_helper.rb'
# Offense count: 8
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.

View File

@@ -84,7 +84,7 @@ RSpec.describe EmbeddedPageService do
end
it "returns a 200 status" do
expect(response.status).to eq 200
expect(response).to have_http_status :ok
end
end
end

View File

@@ -24,7 +24,7 @@ module OpenFoodNetwork
def assert_unauthorized!
expect(json_response).to eq("error" => "You are not authorized to perform that action.")
expect(response.status).to eq 401
expect(response).to have_http_status :unauthorized
end
end
end