[GET] All Subjects #146
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 all possible subjects, so that I can choose one while making a timetable.Acceptance Criteria
GIVEN an
admin
is requesting all possible subjects in the appWHEN the app hits the
/subjects
endpoint with a valid GET requestTHEN 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 going to be accessible for admin only.
Testing Notes
Scenario 1: GET request is successful
GIVEN an
admin
is requesting all possible subjects in the appWHEN the app hits the
/subjects
endpoint with a valid GET requestTHEN the app should receive a status 200
AND the body should be an array
AND the first item of the array should be an object containing the following fields:
Scenario 2: GET request is unsuccessful due to no subjects
GIVEN an
admin
is requesting all possible subjects in the appWHEN the app hits the
/subjects
endpoint with a valid GET requestTHEN the app should receive a status
404
AND the response headers'
code
parameter should contain "NotFoundException"Scenario 3: GET request is forbidden
GIVEN an
student
is requesting all possible subjects in the appWHEN the app hits the
/subjects
endpoint with a valid GET requestTHEN the app should receive a status
403
AND the response headers'
code
parameter should contain "ForbiddenException"Scenario 4: GET request is authorized
GIVEN an
admin
is requesting all possible subjects in the appWHEN the app hits the
/subjects
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: