[GET] All Classes #177
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 a
student
, I should be able to get all possible classes, so that I can choose one for my timetable.Acceptance Criteria
GIVEN an
student
is requesting all possible classes in the appWHEN the app hits the
/classes
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
None.
Testing Notes
Scenario 1: GET request is successful
GIVEN a
student
is requesting all possible classes in the appWHEN the app hits the
/classes
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:
AND the key
classroom
should be an object containing the following fields:AND the key
campus
should be an object containing the following fields:AND the key
subject
should be an object containing the following fields:AND the key
teacher
should be an object containing the following fields:AND the keys
timeslot_1
andtimeslot_2
should be objects containing the following fields:Scenario 2: GET request with query parameters is successful
GIVEN a
student
is requesting all classes in the appWHEN the app hits the
/classes
endpoint with a valid GET requestAND the query parameter contains
subject_code
="MKT201"THEN 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:
AND the key
subject_code
should be equal to MKT201Scenario 3: GET request is unsuccessful due to no classes
GIVEN a
student
is requesting all possible classes in the appWHEN the app hits the
/classes
endpoint with a valid GET requestTHEN the app should receive a status
404
AND the response headers'
code
parameter should contain "NotFoundException"Scenario 4: GET request is incorrect due to unknown query parameters
GIVEN a
student
is requesting all possible reviews of a teacher in the appWHEN the app hits the
/classes
endpoint with a valid GET requestAND contains unknown query parameters
THEN the app should receive a status
422
AND the response headers'
code
parameter should contain "InvalidPropertiesException"AND the response headers'
data
parameter should contain the name of the invalid parametersScenario 5: GET request is unauthorized
GIVEN a
student
is requesting all possible classes in the appWHEN the app hits the
/classes
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: