Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project setup

  1. Clone repo
  2. npm install
  3. npm test

Notes

Pets endpoints

  • can add (POST) pet with only id; probably should not be possible
  • invalid data types and too big numbers causes status 500 not mentioned in the docs
  • if -1 is considered an invalid id then should return status 404 instead of 400
  • if string is considered an invalid id then should return status 404 instead of 400
  • numbers and strings are considered valid statuses
  • in updating (PUT) -1 seems to be a valid id
  • in updating (PUT) always returns data, even when pet with that id doesn't exist

Tests

POST /pet

it: should add a pet and return valid data when all fields are defined
expects: status 200

it: should add a pet and return valid data when only required fields are defined
expects: status 200

it: should add a pet and return valid data when all fields are minimally defined
expects: status 200

it: should return 405 for invalid input
expects: status 405

it: should return 405 for invalid data types
expects: status 405


DELETE /pet/{petId}

it: should delete pet
expects: status 200

it: should return 404 for pet not found
expects: status 404

it: should return 400 for invalid pet id (-1)
expects: status 400

it: should return 400 for invalid pet id (string)
expects: status 400


GET /pet/{petId}

it: should return pet
expects: status 200

it: should return 404 for pet not found
expects: status 404

it: should return 400 for invalid pet id (-1)
expects: status 400

it: should return 400 for invalid pet id (string)
expects: status 400


GET /pet/findByStatus

it: should return pet
expects: status 200

it: should return 400 for invalid status (string)
expects: status 400 and everything to have status: "pending"

it: should return 400 for invalid status (number)
expects: status 400


PUT /pet

it: should update a pet and return updated data when all fields are defined
expects: status 200 and updated data

it: should update a pet and not return data when minimal fields are defined
expects: status 200 and updated data

it: should return 400 for invalid pet id (-1)
expects: status 400

it: should return 400 for invalid pet id (string)
expects: status 400

it: should return 400 for too big of a pet id
expects: status 400

it: should return 404 for pet not found
expects: status 404

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages