[GET] A Single Subject #147
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 get details of a subject, so that I can understand what information it represents.Acceptance Criteria
GIVEN an
admin
is requesting details of a subject in the appWHEN the app hits the
/subjects/:code
endpoint with a valid GET request, containing the path parameter::code
, the unique id of the entity for which the details are needed.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
This endpoint is accessible by and serves the admin in the same way.
Testing Notes
Scenario 1: GET request is successful
GIVEN an
admin
is requesting details of a subject in the appWHEN the app hits the
/subjects/:code
endpoint with a valid GET request, containing the path parameter::code
THEN the app should receive a status
200
AND the
{code}
in the body should be same as the:code
in the path parameterScenario 2: GET request is unsuccessful
GIVEN an
admin
is requesting details of a subject in the appWHEN the app hits the
/subjects/:code
endpoint with a valid GET request, containing the path parameter::code
, a non-existent idTHEN the app should receive a status
404
AND the response headers'
code
parameter should contain "NotFoundException"Scenario 3: GET request is forbidden
GIVEN a
student
is requesting details of a subject in the appWHEN the app hits the
/subjects/:code
endpoint with a valid GET requestTHEN the app should receive a status
403
AND the response headers'
code
parameter should contain "TokenMissingException"Scenario 4: GET request is unauthorized
GIVEN an
admin
is requesting details of a subject in the appWHEN the app hits the
/subjects/:code
endpoint with a valid GET requestAND the request contains no authorization token
THEN the app should receive a status
401
AND the response headers'
code
parameter should contain "TokenMissingException"The text was updated successfully, but these errors were encountered: