spec/support/fake_api.rb in finapps-5.0.13 vs spec/support/fake_api.rb in finapps-5.0.14
- old
+ new
@@ -57,20 +57,20 @@
json_response 200, 'plaid/account/show.json'
end
put("/#{version}/p/accounts/permissions") do
request.body.rewind
request_payload = JSON.parse request.body.read
- if request_payload.respond_to?(:key?) && request_payload.key?('ids')
+ if request_payload.is_a? Array
status 204
else
json_response 400, 'invalid_request_body.json'
end
end
delete("/#{version}/p/accounts/permissions") do
request.body.rewind
request_payload = JSON.parse request.body.read
- if request_payload.respond_to?(:key?) && request_payload.key?('ids')
+ if request_payload.is_a? Array
status 204
else
json_response 400, 'invalid_request_body.json'
end
end
@@ -140,18 +140,10 @@
json_response 404, 'resource_not_found.json'
end
put("/#{version}/orders/invalid_id") do
json_response 404, 'resource_not_found.json'
end
- put("/#{version}/orders/valid_id") do
- request.body.rewind
- request_payload = JSON.parse request.body.read
- if request_payload['accounts'] == 'valid_account'
- status 204
- else
- json_response 400, 'invalid_request_body.json'
- end
- end
+ put("/#{version}/orders/valid_id") { status 204 }
post("/#{version}/orders") do
request.body.rewind
request_payload = JSON.parse request.body.read
if %w[applicant institutions product].all? { |s| request_payload.key? s }
json_response 200, 'order_token.json'