As a admin, I should be able to update the details of a hobby, so that I can fix old or inconsistent hobby entries #36
Labels
Status: Completed
Type: Feature
user story
A brief explanation of a functionality or an interaction with the system, from a user's perspective
Summary
As an
admin
, I should be able to update the details of a hobby, so that I can fix old or inconsistent hobby entries.Acceptance Criteria
GIVEN an
admin
is editing a hobby in the appWHEN the app hits the
hobbies/:id
endpoint with a valid PATCH request, containing:-The path parameter:
:id
, the unique id of the hobby of which the details are edited.And any of the following body parameters:
THEN the app should receive a status
200
AND in the response, the following information should be returned:
Sample Request/Sample Response
Resources
Dev Notes
{Some complementary notes if necessary}
Testing Notes
Scenario 1: PATCH request is successful
/hobbies/:id
endpoint/hobbies/:id
endpoint should return a status code200
hobbies/:id
endpoint to reverse the change and ensure status code200
is returned.Scenario 2: PATCH request is unsuccessful
/hobbies/:id
endpoint containing a non-existenthobby_id
.404
status code is returned.code
parameter should contain "NotFoundException".Scenario 3: PATCH request is incorrect
/hobbies/:id
endpoint with an incorrect key name in the body422
status code is returnedcode
parameter should contain "InvalidPropertiesException".data
parameter should contain the name of the invalid parameter.Scenario 4: PATCH request is forbidden
/hobbies/:id
endpoint using astudent
account token.403
forbidden status code.code
parameter should contain "ForbiddenException"Scenario 5: PATCH request is unauthorized
/hobbies
endpoint without an authorization token401
unauthorized status code is returned.code
parameter should contain "TokenMissingException"The text was updated successfully, but these errors were encountered: