The v1 test file points at localhost, not the render instance so I cannot run those
The following are the results from running every curl statement in order on v2. I was unable to get a single 200 response back. I tried pasting the non post commands into a browser and was able to get a response back from a few of them, I included them below. I suspect these curl statements were never run from a terminal with no configuration...
{"transactions":[{"transaction_id":5,"from_user_id":3,"to_user_id":2,"description":"Roommate paying Test User","date":"2023-11-07T22:35:43.256608+00:00"}]}
Correcting an Error
$ curl -v -X 'GET' \
> 'http://payback-app-rjwr.onrender.com/groups/1/transactions' \
> -H 'accept: application/json'
Note: Unnecessary use of -X or --request, GET is already inferred.
* Trying 216.24.57.3:80...
* Connected to payback-app-rjwr.onrender.com (216.24.57.3) port 80 (#0)
> GET /groups/1/transactions HTTP/1.1
> Host: payback-app-rjwr.onrender.com
> User-Agent: curl/8.1.2
> accept: application/json
>
< HTTP/1.1 301 Moved Permanently
< Date: Sat, 11 Nov 2023 19:13:50 GMT
< Content-Type: text/html; charset=utf-8
< Content-Length: 94
< Connection: keep-alive
< Location: https://payback-app-rjwr.onrender.com/groups/1/transactions
< CF-Ray: 8248dad14d38158a-SJC
< CF-Cache-Status: DYNAMIC
< Server: cloudflare
< alt-svc: h3=":443"; ma=86400
<
<a href="https://payback-app-rjwr.onrender.com/groups/1/transactions">Moved Permanently</a>.
* Connection #0 to host payback-app-rjwr.onrender.com left intact
when hitting the above in a browser i get
{"transactions":[{"transaction_id":1,"from_user_id":1,"to_user_id":2,"description":"Paid for trip","date":"2023-11-07T10:05:52.826359+00:00"},{"transaction_id":2,"from_user_id":1,"to_user_id":1,"description":"Paid for trip","date":"2023-11-07T10:05:52.826359+00:00"}]}
Because I wasn't able to get any of the curl statements to work I am providing expected responses not real responses.
1. Create a group and have 2 members join, then get the group details to ensure all users joined correctly. 3 users with ids 1, 2 and 3 must be prepopulated before this test.
The api is not complete and does not currently include this functionality but it definitely should. You should not rely on the groups/{id} endpoint as the only way to get the users in a group. You must have at least one user in a group for the setup of this test.
{
"members": [
{
"user_id": 1,
"name": "User1",
"email": "user1@example.com"
}
// Remaining members, excluding the user who left
]
}
3. adding transactions to a group and then listing them.
Seeding: Must have a trip with id 1 that Users with ids 1 and 2 are a part of. Also must have a trip with id 1 belonging to the group_id. Users must be a part of group_id.
Running Existing Tests
The v1 test file points at localhost, not the render instance so I cannot run those
The following are the results from running every curl statement in order on v2. I was unable to get a single 200 response back. I tried pasting the non post commands into a browser and was able to get a response back from a few of them, I included them below. I suspect these curl statements were never run from a terminal with no configuration...
Tracking Expenses
When hitting the above in a browser i get back
Correcting an Error
when hitting the above in a browser i get
Suggestions for new tests
Because I wasn't able to get any of the curl statements to work I am providing expected responses not real responses.
1. Create a group and have 2 members join, then get the group details to ensure all users joined correctly. 3 users with ids 1, 2 and 3 must be prepopulated before this test.
Create group
Expected Response:
First User Joins the Group
Expected Response (I included a descriptive message that you should include in the response):
Second User Joins the Group
Get group details
Response:
2. A user leaves a group
The api is not complete and does not currently include this functionality but it definitely should. You should not rely on the groups/{id} endpoint as the only way to get the users in a group. You must have at least one user in a group for the setup of this test.
Verify User is Part of the Group
Response
User Leaves the Group
Response:
Verify Removal
Response:
3. adding transactions to a group and then listing them.
Seeding: Must have a trip with id 1 that Users with ids 1 and 2 are a part of. Also must have a trip with id 1 belonging to the group_id. Users must be a part of group_id.
Add the first transaction
Response:
Add the second transaction
Response:
List transactions
Response: