mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-27 21:06:49 +00:00
Use already parsed JSON in specs
Existing helpers provide indifferent access already.
This commit is contained in:
@@ -3,15 +3,7 @@
|
||||
module OpenFoodNetwork
|
||||
module ApiHelper
|
||||
def json_response
|
||||
json_response = JSON.parse(response.body)
|
||||
case json_response
|
||||
when Hash
|
||||
json_response.with_indifferent_access
|
||||
when Array
|
||||
json_response.map(&:with_indifferent_access)
|
||||
else
|
||||
json_response
|
||||
end
|
||||
response.parsed_body
|
||||
end
|
||||
|
||||
def json_response_ids
|
||||
|
||||
Reference in New Issue
Block a user