mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Fixes RSpec Rails HaveHttpStatus cop in services & support
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user