Use already parsed JSON in specs

Existing helpers provide indifferent access already.
This commit is contained in:
Maikel Linke
2025-10-10 16:35:18 +11:00
parent 8ccceccd92
commit 378b5e656e

View File

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