This repository has been archived by the owner on Feb 8, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 308
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c2cee2d
commit b4fe99e
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
interactions: | ||
- request: | ||
body: '{"amount": 1061, "meta": {"state": "new", "participant_id": 2}, "description": | ||
"janet"}' | ||
headers: {} | ||
method: POST | ||
uri: https://api.balancedpayments.com:443/cards/CC6j2lN0CEuf3wt77J2bQW7r/card_holds | ||
response: | ||
body: {string: !!python/unicode "{\n \"errors\": [\n {\n \"status\": | ||
\"Conflict\",\n \"category_code\": \"card-not-valid\",\n \"additional\": | ||
null,\n \"status_code\": 409,\n \"category_type\": \"logical\",\n | ||
\ \"extras\": {},\n \"request_id\": \"OHMfbff8b86de4111e4a95a06429171ffad\",\n | ||
\ \"description\": \"Card has been invalidated. Your request id is OHMfbff8b86de4111e4a95a06429171ffad.\"\n | ||
\ }\n ]\n}"} | ||
headers: | ||
content-length: ['373'] | ||
content-type: [application/json] | ||
status: {code: 409, message: CONFLICT} | ||
- request: | ||
body: null | ||
headers: {} | ||
method: GET | ||
uri: https://api.balancedpayments.com:443/credits?meta%5Bcontains%5D=exchange_id&limit=25&offset=0 | ||
response: | ||
body: {string: !!python/unicode "{\n \"credits\": [],\n \"meta\": {\n \"last\": | ||
\"/credits?limit=25&meta%5Bcontains%5D=exchange_id&offset=0\",\n \"next\": | ||
null,\n \"href\": \"/credits?limit=25&meta%5Bcontains%5D=exchange_id&offset=0\",\n | ||
\ \"limit\": 25,\n \"offset\": 0,\n \"previous\": null,\n \"total\": | ||
0,\n \"first\": \"/credits?limit=25&meta%5Bcontains%5D=exchange_id&offset=0\"\n | ||
\ },\n \"links\": {}\n}"} | ||
headers: | ||
content-length: ['360'] | ||
content-type: [application/json] | ||
status: {code: 200, message: OK} | ||
- request: | ||
body: null | ||
headers: {} | ||
method: GET | ||
uri: https://api.balancedpayments.com:443/debits?meta%5Bcontains%5D=exchange_id&limit=25&offset=0 | ||
response: | ||
body: {string: !!python/unicode "{\n \"meta\": {\n \"last\": \"/debits?limit=25&meta%5Bcontains%5D=exchange_id&offset=0\",\n | ||
\ \"next\": null,\n \"href\": \"/debits?limit=25&meta%5Bcontains%5D=exchange_id&offset=0\",\n | ||
\ \"limit\": 25,\n \"offset\": 0,\n \"previous\": null,\n \"total\": | ||
0,\n \"first\": \"/debits?limit=25&meta%5Bcontains%5D=exchange_id&offset=0\"\n | ||
\ },\n \"links\": {},\n \"debits\": []\n}"} | ||
headers: | ||
content-length: ['356'] | ||
content-type: [application/json] | ||
status: {code: 200, message: OK} | ||
version: 1 |
b4fe99e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please avoid adding test fixtures when you're not actually testing the interaction with the remote service.
b4fe99e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By using mock to stub out the call?
b4fe99e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or by unrolling the test to avoid the external calls entirely: bd5f789.
!m @Changaco