andela / ah-kgl-wakanda-backend

0 stars 5 forks source link

#165020124 user should crud articles #10

Closed gracelungu closed 5 years ago

gracelungu commented 5 years ago

What does this PR do?

This PR creates and tests endpoints for performing CRUD operations on the articles.

Description of Task to be completed?

~ User should create an article ~ User should be able to get an article ~ User should be able to get all articles ~ User should be able to update an article ~ User should be able to delete an article ~ Test all endpoints ~ Document the endpoints with swagger

How should this be manually tested?

This can be tested using postman and the API documentation for reference. ~ First clone the repo https://github.com/andela/ah-kgl-wakanda-backend.git . ~ Install the required dependencies using npm install && npm start ~ In the web browser open the API doc at localhost:3000/doc for reference ~ Use postman to test, with specifications found in the documentation. ~ Remember to put a valid URL for the images.

Any background context you want to provide?

The endpoints are missing authorization middlewares, Which is currently in development in another branch.

What are the relevant pivotal tracker stories?

165020124

Screenshots (if appropriate)

~ Creating an article : ~ . The URL and method image ~ . The body image ~ . The response object image

Questions:

N/A

dkam26 commented 5 years ago

Hey @gracelungu, Great work, here is some feedback on your work:

gracelungu commented 5 years ago

Hey @gracelungu, Great work, here is some feedback on your work:

  • Edit your swagger documentation to give the accurate description of the JSON object bodies. for example, the API endpoint for creating an article requires a JSON object with one key "article" and the value to be the object to be created, however, your swagger documentation doesn't include that. Please fix that.
  • Always respect the hound-ci styling standards.
  • The code has lowered the code coverage by 12%. Kindly write more unit tests.

~ I have edited the swagger doc with appropriate bodies, and also managed to increase the coverage.