spruhaN / nutrition_pal

1 stars 1 forks source link

Test results (Kyle Reyes) #24

Open Proefey opened 4 months ago

Proefey commented 4 months ago

Example WorkFlow 1: Stephanie has some goals and wants to start tracking her calories and meals. First she POST /goals passing “lose weight”, “diet” and 2000 Next she eats food and does a POST /meal passing “Mexican” and 800. She wants to see how many calories she has left GET /daily_calories returning 1200. She then eats a pizza, POSTS /meal passing “Italian” 1200. Checks calories with GET /daily_calories, returns 0. Next day GET /meal/day returning a list of meals with an id, type, calorie, and time stamp

curl -X 'POST' \ 'https://nutrition-pal.onrender.com/user' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "name": "Stephanie", "weight": 100, "height": 6 }' Response: { "id": 53 }

curl -X 'POST' \ 'https://nutrition-pal.onrender.com/goals/53' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "goal": "lose weight", "type": "diet", "daily_calories": 2000 }'

Response "OK"

curl -X 'POST' \ 'https://nutrition-pal.onrender.com/meal/53' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "name": "Mexican", "calories": 800 }'

Response "OK"

curl -X 'GET' \ 'https://nutrition-pal.onrender.com/daily_calories/53' \ -H 'accept: application/json'

Response { "calories_left": 1200 }

curl -X 'POST' \ 'https://nutrition-pal.onrender.com/meal/53' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "name": "Italian", "calories": 1200 }'

Response: "OK"

curl -X 'GET' \ 'https://nutrition-pal.onrender.com/daily_calories/53' \ -H 'accept: application/json' Response{ "calories_left": 0 }

curl -X 'GET' \ 'https://nutrition-pal.onrender.com/meal/53/day' \ -H 'accept: application/json'

Response: [ { "name": "Mexican", "calories": 800, "time": "2024-05-21T06:36:07.852978+00:00", "type": null }, { "name": "Italian", "calories": 1200, "time": "2024-05-21T06:37:00.471566+00:00", "type": null } ]

WorkFlow 2: Marc wants to build muscle Marc enters his goals by calling POST /goals passing “get big”, “workout”, 2800. He then begins adding workouts with with POST /workout passing “push-up”, 3, 10, 14. He does this with multiple workouts at varying lengths, set, reps. His friends asks him what workouts he’s done, so he GET /workouts/days and returns a list of workout with “id”, “name”, “sets”, “reps”, “length”, and “time” His friend asks what to do for back, GET /workout/muscle_group/{type} passing “back” as type and returns a list of workouts “id”, “name”, “sets”, “reps”, “length”, and “time”, for the back

curl -X 'POST' \ 'https://nutrition-pal.onrender.com/user' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "name": "Marc", "weight": 100, "height": 6 }' Response:{ "id": 54 }

curl -X 'POST' \ 'https://nutrition-pal.onrender.com/goals/54' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "goal": "get big", "type": "workout", "daily_calories": 2800 }'

Response: "OK"

curl -X 'POST' \ 'https://nutrition-pal.onrender.com/workout/54' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "name": "chest_press", "sets": 3, "reps": 10, "length": 14 }'

Response: "OK"

curl -X 'GET' \ 'https://nutrition-pal.onrender.com/workouts/54/day' \ -H 'accept: application/json'

Response: [ { "id": 13, "name": "chest_press", "type": "front", "group": "chest", "sets": 3, "reps": 10, "length": 14 } ]

curl -X 'GET' \ 'https://nutrition-pal.onrender.com/workouts/muscle_groups/back' \ -H 'accept: application/json'

Response: [ { "name": "lat_pulldown", "type": "back", "group": "lats" }, { "name": "cable_row", "type": "back", "group": "traps" }, { "name": "pull_up", "type": "back", "group": "lats" }, { "name": "bent_over_dumbell_row", "type": "back", "group": "lats" } ]

WorkFlow 3: Andrew M. is jealous of his roommate’s incredible physique. Andrew starts with a POST /goals passing “get big”, “workout”, 2800. He posts a workout POST /workout “pull-up”, 3, 4, 10. He does this for a variety of workouts. He wants to see what his workouts hit so he starts with GET /workout/day and gets a list of “id”, “name”, “sets”, “reps”, “length”, and “time” He wants to see what his chest-press hits so he does a GET /workout/{id}/muscle_groups passing an id in that was in the prior return. This returns a list of strings [“chest”, “triceps”, “shoulders”]

curl -X 'POST' \ 'https://nutrition-pal.onrender.com/user' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "name": "Andrew M.", "weight": 100, "height": 6 }'

Response: { "id": 55 }

curl -X 'POST' \ 'https://nutrition-pal.onrender.com/goals/55' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "goal": "get big", "type": "workout", "daily_calories": 2800 }' Response "OK"

curl -X 'POST' \ 'https://nutrition-pal.onrender.com/workout/55' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "name": "pull_up", "sets": 3, "reps": 4, "length": 10 }' Response "OK"

curl -X 'GET' \ 'https://nutrition-pal.onrender.com/workouts/55/day' \ -H 'accept: application/json' Response: [ { "id": 9, "name": "pull_up", "type": "back", "group": "lats", "sets": 3, "reps": 4, "length": 10 } ]

curl -X 'GET' \ 'https://nutrition-pal.onrender.com/workout/9/muscle_groups' \ -H 'accept: application/json'

[ { "name": "pull_up", "type": "back", "group": "lats" } ]

New Test Case1: John wants to try to set a new diet plan of 1600 calories However, over the course of 3 meals he eats 1800 calories, checking his calorie count between each meal

curl -X 'POST' \ 'https://nutrition-pal.onrender.com/user' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "name": "John", "weight": 100, "height": 6 }' Response: { "id": 56 }

curl -X 'POST' \ 'https://nutrition-pal.onrender.com/goals/56' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "goal": "get slim", "type": "diet", "daily_calories": 1600 }' Response: "OK"

curl -X 'POST' \ 'https://nutrition-pal.onrender.com/meal/56' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "name": "Italian", "calories": 400 }' Response: "OK"

curl -X 'GET' \ 'https://nutrition-pal.onrender.com/daily_calories/56' \ -H 'accept: application/json' Response: { "calories_left": 1200 }

curl -X 'POST' \ 'https://nutrition-pal.onrender.com/meal/56' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "name": "Mexican", "calories": 600 }' Response: "OK"

curl -X 'GET' \ 'https://nutrition-pal.onrender.com/daily_calories/56' \ -H 'accept: application/json' Response: { "calories_left": 600 }

curl -X 'POST' \ 'https://nutrition-pal.onrender.com/meal/56' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "name": "American", "calories": 800 }' Response: "OK"

curl -X 'GET' \ 'https://nutrition-pal.onrender.com/daily_calories/56' \ -H 'accept: application/json' Response: { "calories_left": -200 } New Test Case2: John wants to adjust his expectations, so he attempts to set a new calorie goal above where he initially was at 1900 calories and makes a new account. But afterwards, he attempts to overwrite his previous goal with one back to 1600 calories.

curl -X 'POST' \ 'https://nutrition-pal.onrender.com/user' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "name": "John", "weight": 100, "height": 6 }' Response: { "id": 57 }

curl -X 'POST' \ 'https://nutrition-pal.onrender.com/goals/57' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "goal": "get slim 2", "type": "diet", "daily_calories": 1900 }' Response: "OK"

curl -X 'GET' \ 'https://nutrition-pal.onrender.com/daily_calories/57' \ -H 'accept: application/json'

Response: { "calories_left": 1900 }

curl -X 'POST' \ 'https://nutrition-pal.onrender.com/goals/57' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "goal": "get slim Again", "type": "diet", "daily_calories": 1600 }' Response: "OK"

curl -X 'GET' \ 'https://nutrition-pal.onrender.com/daily_calories/57' \ -H 'accept: application/json'

Response: { "calories_left": 1900 }

New Test Case 3: John wishes to workout his back, so he searches for a workout that work on his back and does half of them for 20 minutes. Then checks his progress at the end.

curl -X 'POST' \ 'https://nutrition-pal.onrender.com/user' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "name": "John", "weight": 100, "height": 6 }' Response: { "id": 58 }

curl -X 'GET' \ 'https://nutrition-pal.onrender.com/workouts/muscle_groups/back' \ -H 'accept: application/json' Response: [ { "name": "lat_pulldown", "type": "back", "group": "lats" }, { "name": "cable_row", "type": "back", "group": "traps" }, { "name": "pull_up", "type": "back", "group": "lats" }, { "name": "bent_over_dumbell_row", "type": "back", "group": "lats" } ]

curl -X 'POST' \ 'https://nutrition-pal.onrender.com/workout/58' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "name": "lat_pulldown", "sets": 30, "reps": 40, "length": 10 }' Response: "OK"

curl -X 'POST' \ 'https://nutrition-pal.onrender.com/workout/58' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "name": "bent_over_dumbell_row", "sets": 3, "reps": 4, "length": 10 }' Response: "OK"

curl -X 'GET' \ 'https://nutrition-pal.onrender.com/workouts/58/day' \ -H 'accept: application/json'

Response: [ { "id": 1, "name": "lat_pulldown", "type": "back", "group": "lats", "sets": 30, "reps": 40, "length": 10 }, { "id": 10, "name": "bent_over_dumbell_row", "type": "back", "group": "lats", "sets": 3, "reps": 4, "length": 10 } ]