spec/support/fake_api.rb in finapps-2.0.20 vs spec/support/fake_api.rb in finapps-2.0.21
- old
+ new
@@ -13,17 +13,43 @@
# orders
post('/v2/orders/valid_token') { json_response 200, 'order_token.json' }
post('/v2/orders/invalid_token') { json_response 404, 'resource_not_found.json' }
get('/v2/orders/:id') { json_response 200, 'resource.json' }
get('/v2/list/orders/:page/:requested/:sort/:asc') { json_response 200, 'orders.json' }
+ put('/v2/orders/invalid_id') { json_response 404, 'resource_not_found.json' }
+ put('/v2/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
+
# institutions
get('/v2/institutions/site/valid_site_id/form') { json_response 200, 'institution_login_form.json' }
get('/v2/institutions/site/invalid_site_id/form') { json_response 400, 'invalid_institution_id.json' }
post('/v2/institutions/site/valid_site_id/add') { json_response 200, 'institution_add.json' }
post('/v2/institutions/site/invalid_site_id/add') { json_response 400, 'invalid_institution_id.json' }
get('/v2/institutions/search/:search_term') { json_response 200, 'institutions_search_list.json' }
+ # user institutions
+ get('/v2/institutions/user/valid_id/status') { json_response 200, 'user_institution_status.json' }
+ get('/v2/institutions/user/invalid_id/status') { json_response 400, 'invalid_user_institution_id.json' }
+ get('/v2/institutions/user') { json_response 200, 'user_institutions_list.json' }
+ get('/v2/institutions/user/valid_id') { json_response 200, 'user_institutions_show.json' }
+ get('/v2/institutions/user/invalid_id') { json_response 400, 'invalid_user_institution_id.json' }
+ put('/v2/institutions/user/refresh') { json_response 200, 'user_institutions_refresh_all.json' }
+ put('/v2/institutions/user/valid_id/credentials') { json_response 200, 'institution_add.json' }
+ put('/v2/institutions/user/invalid_id/credentials') { json_response 400, 'invalid_user_institution_id.json' }
+ put('/v2/institutions/user/valid_id/mfa') { json_response 200, 'institution_add.json' }
+ put('/v2/institutions/user/invalid_id/mfa') { json_response 400, 'invalid_user_institution_id.json' }
+ delete('/v2/institutions/user/valid_id') { status 204 }
+ delete('/v2/institutions/user/invalid_id') { json_response 400, 'invalid_user_institution_id.json' }
+ get('/v2/institutions/user/valid_id/form') { json_response 200, 'institution_login_form.json' }
+ get('/v2/institutions/user/invalid_id/form') { json_response 400, 'invalid_institution_id.json' }
# users
get('/v2/users/valid_public_id') { json_response 200, 'user.json' }
get('/v2/users/invalid_public_id') { json_response 404, 'resource_not_found.json' }
put('/v2/users/valid_public_id') { status 204 }