[PATCH] A Subject #148
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 subject, so that I can fix old or inconsistent entries.Acceptance Criteria
GIVEN an
admin
is editing a subject in the appWHEN the app hits the
/subjects/:code
endpoint with a valid PATCH request, containing:-The path parameter:
:code
, the unique id of the entity 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
/subjects/:code
endpoint/subjects/:code
endpoint should return a status code200
/subjects/:code
endpoint to reverse the change and ensure status code200
is returned.Scenario 2: PATCH request is unsuccessful due to unknown subject_code
/subjects/:code
endpoint containing a non-existentsubject_code
.404
status code is returned.code
parameter should contain "NotFoundException".Scenario 3: PATCH request is incorrect
/subjects/:code
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
/subjects/:code
endpoint using astudent
account token.403
forbidden status code.code
parameter should contain "ForbiddenException"Scenario 5: PATCH request is unauthorized
/subjects/:code
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: