spec/support/fake_api.rb in finapps-5.0.32 vs spec/support/fake_api.rb in finapps-5.0.33

- old
+ new

@@ -193,28 +193,34 @@ end end 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 } + if %w[applicant institutions product].all? {|s| request_payload.key? s } json_response 200, 'order_token.json' else json_response 400, 'invalid_request_body.json' end end # documents_orders - get("/#{version}/documents/orders") { json_response 200, 'documents_orders.json' } + get("/#{version}/documents/orders") do + if params[:filter]&.include?('"status":2') + json_response 200, 'documents_orders_none.json' + else + json_response 200, 'documents_orders.json' + end + end get("/#{version}/documents/orders/valid_order_id") do json_response 200, 'documents_order.json' end get("/#{version}/documents/orders/invalid_order_id") do json_response 404, 'resource_not_found.json' end post("/#{version}/documents/orders") do request.body.rewind request_payload = JSON.parse request.body.read - if %w[applicant esign_documents tag].all? { |s| request_payload.key? s } + if %w[applicant esign_documents tag].all? {|s| request_payload.key? s } json_response 200, 'documents_order.json' else json_response 400, 'invalid_request_body.json' end end