n-shinde / PeakPeeps

Group Project for CSC 365
0 stars 0 forks source link

Test results Parshana Sekhon [ignore 1st comment look at 2nd comment :O] #13

Open Parshana007 opened 10 months ago

Parshana007 commented 10 months ago

Example workflow

Roxanne is a college student and she wants to spend her weekends exploring the outdoors more.

She learns about the app PeakPeeps and decides to add herself as a user. POST /users/create_account She knows her friend Bob is on the app, and adds him as a follower. POST /users/add_follower. Alas, Bob lied and he actually hasn’t been on the app and has been lazy. She is sure that her friend Fred is on the app and adds him as a follower. POST /users/add_follower. They got into a fight and Roxanne doesn’t want to be friends with Fred since Fred stole Roxanne’s potions and gets rid of him as a follower. POST /users/remove_follower

Testing results

  1. Calling POST /users/create_account
curl -X 'POST' \
  'https://peak-peeps.onrender.com/users/create_account' \
  -H 'accept: application/json' \
  -H 'access_token: PeepCoins123!' \
  -H 'Content-Type: application/json' \
  -d '{
  "username": "Roxanne"
}'
  1. Response
"OK"
  1. Calling POST /users/add_follower
curl -X 'POST' \
  'https://peak-peeps.onrender.com/users/add_follower' \
  -H 'accept: application/json' \
  -H 'access_token: PeepCoins123!' \
  -H 'Content-Type: application/json' \
  -d '{
  "user_to_update": {
    "username": "Roxanne"
  },
  "follower_to_add": {
    "username": "Bob"
  }
}'
  1. Response [500 Error writing what should be returned]
{
  “ERROR: Bob isn’t a user in the app”.
}
  1. Calling POST /users/add_follower
curl -X 'POST' \
  'https://peak-peeps.onrender.com/users/add_follower' \
  -H 'accept: application/json' \
  -H 'access_token: PeepCoins123!' \
  -H 'Content-Type: application/json' \
  -d '{
  "user_to_update": {
    "username": "Roxanne"
  },
  "follower_to_add": {
    "username": "Fred"
  }
}'
  1. Response [500 Error writing what should be returned]
{
  “OK”
}
  1. Calling POST /users/remove_follower
curl -X 'POST' \
  'https://peak-peeps.onrender.com/users/add_follower' \
  -H 'accept: application/json' \
  -H 'access_token: PeepCoins123!' \
  -H 'Content-Type: application/json' \
  -d '{
  "user_to_update": {
    "username": "Roxanne"
  },
  "follower_to_add": {
    "username": "Fred"
  }
}'
  1. Response [500 Error writing what should be returned]
{
  “OK”
}

Example workflow

Joe and Jim’s Gym wants to promote PeakPeeps and healthy habits.

Joe registers the business by calling PUT/business/add And adds coupons PUT /coupons/add Sammy sees the coupons and wants to buy their coupon on milkshakes POST /peepcoins/purchase/coupon. Unfortunately, Sammy is lazy and doesn’t have any routes added and therefore unable to purchase the coupon.

Testing results

  1. Calling PUT/business/add
curl -X 'PUT' \
  'https://peak-peeps.onrender.com/business/add' \
  -H 'accept: application/json' \
  -H 'access_token: PeepCoins123!' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "Joe and Jim'\''s Gym",
  "address": "500 Foothill St."
}'
  1. Response
"OK"
  1. Calling PUT /coupons/add
curl -X 'PUT' \
  'https://peak-peeps.onrender.com/coupons/add' \
  -H 'accept: application/json' \
  -H 'access_token: PeepCoins123!' \
  -H 'Content-Type: application/json' \
  -d '{
  "business_id": 3, [NOTE: didn’t know what business_id to put since not mentioned anywhere]
  "name": "Buy Protein",
  "cost": 20
}'
  1. Response [500 Error writing what should be returned]
{
 “OK”
}
  1. Calling PUT /coupons/add
curl -X 'PUT' \
  'https://peak-peeps.onrender.com/coupons/add' \
  -H 'accept: application/json' \
  -H 'access_token: PeepCoins123!' \
  -H 'Content-Type: application/json' \
  -d '{
  "business_id": 3, [NOTE: didn’t know what business_id to put since not mentioned anywhere]
  "name": "Buy Milkshakes",
  "cost": 20
}'
  1. Response [500 Error writing what should be returned]
{
 “OK”
}
  1. Calling POST /peepcoins/purchase/coupon
curl -X 'POST' \
  'https://peak-peeps.onrender.com/peepcoins/purchase/coupon' \
  -H 'accept: application/json' \
  -H 'access_token: PeepCoins123!' \
  -H 'Content-Type: application/json' \
  -d '{
  "coupon_id": 1, [NOTE: didn’t know how to get either of these values]
  "user_id": 1
}'
  1. Response [500 Error writing what should be returned]
{
  “OK”
}

Example workflow

Jack and Jill are attempting to run a pyramid scheme and are trying to post as many routes as possible to get money to buy coupons.

They both create accounts using POST /users/create_account They then add each other as best friends POST /users/add_follower They start adding routes POST /routes/add They then get all the popular routes and begin visiting all of the ones in SLO GET /routes/popular

Testing results

  1. Calling POST /users/create_account
curl -X 'POST' \
  'https://peak-peeps.onrender.com/users/create_account' \
  -H 'accept: application/json' \
  -H 'access_token: PeepCoins123!' \
  -H 'Content-Type: application/json' \
  -d '{
  "username": "Jack"
}'
  1. Response
"OK"
  1. Calling POST /users/create_account
curl -X 'POST' \
  'https://peak-peeps.onrender.com/users/create_account' \
  -H 'accept: application/json' \
  -H 'access_token: PeepCoins123!' \
  -H 'Content-Type: application/json' \
  -d '{
  "username": "Jill"
}'
  1. Response
"OK"
  1. Calling POST /users/add_follower
curl -X 'POST' \
  'https://peak-peeps.onrender.com/users/add_follower' \
  -H 'accept: application/json' \
  -H 'access_token: PeepCoins123!' \
  -H 'Content-Type: application/json' \
  -d '{
  "user_to_update": {
    "username": "Jack"
  },
  "follower_to_add": {
    "username": "Jill"
  }
}'
  1. Response [500 Error writing what should be returned]
{
  “OK”
}
  1. Calling POST /routes/add
curl -X 'POST' \
  'https://peak-peeps.onrender.com/routes/add' \
  -H 'accept: application/json' \
  -H 'access_token: PeepCoins123!' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "The P",
  "user_id": 4,
  "location": "SLO",
  "coordinates": [
    100, 100
  ],
  "length": 10,
  "difficulty": 1,
  "activities": "Watched Sunset"
}'
  1. Response [Not sure how to connect an id to a user]
{
  “OK”
}
  1. Calling POST /routes/add
curl -X 'POST' \
  'https://peak-peeps.onrender.com/routes/add' \
  -H 'accept: application/json' \
  -H 'access_token: PeepCoins123!' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "The P",
  "user_id": 5,
  "location": "SLO",
  "coordinates": [
    100, 100
  ],
  "length": 10,
  "difficulty": 1,
  "activities": "Watched Sunset :O"
}'
  1. Response [Not sure how to connect an id to a user]
{
  “OK”
}
  1. Calling GET /routes/followers
curl -X 'GET' \
  'https://peak-peeps.onrender.com/routes/followers?friend_username=Jack' \
  -H 'accept: application/json' \
  -H 'access_token: PeepCoins123!'
  1. Response [Not sure how to connect an id to a user]
[
{
 "name": "The P",
  "location": "SLO",
  "coordinates": [
    100, 100
  ],
  "length": 10,
  "difficulty": 1,
  "activities": "Watched Sunset :O"
}
]
  1. Calling GET /routes/popular
curl -X 'GET' \
  'https://peak-peeps.onrender.com/routes/popular' \
  -H 'accept: application/json' \
  -H 'access_token: PeepCoins123!'
  1. Response [Not displaying correct info]
[
{
 "name": "Bishop",
  "location": "SLO",
  "coordinates": [
    200, 100
  ],
  "length": 15,
  "difficulty": 5,
  "activities": "Watched Sunsets"
}
]