[GET] An Activity's Attendees #96
Labels
Status: Completed
Type: Enhancement
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 attendees of an activity, so that I can see who's interested.Acceptance Criteria
Scenario 1: Get All Attendees Of An Activities
GIVEN an
student
is requesting attendees of an activity in the appWHEN the app hits the
/activities/:id/attendees
endpoint with a valid GET request, containing the path parameter::id
, the unique id of the entity for which the attendees are needed.THEN the app should receive a status
200
AND in the response, the following information should be returned:
Sample Request/Sample Response
Scenario 2: Get All Filtered Attendees Of An Activity
GIVEN a
student
is requesting attendees of an activities in the appWHEN the app hits the
/activities/:id/attendees
endpoint with a valid GET request containing query parameters, either:THEN the app should receive a status
200
AND in the response, the following information should be returned:
Sample Request/Sample Response
For e.g. we want all going attendees of an activity .i.e.
involvment_type
=goingResources
Dev Notes
This endpoint is accessible by and serves the admin in the same way.
Testing Notes
Scenario 1: GET request is successful
GIVEN a
student
is requesting attendees of an activity in the appWHEN the app hits the
/activities/:id/attendees
endpoint with a valid GET request, containing the path parameter::id
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:
Scenario 2: GET request is unsuccessful due to unknown activity_id
GIVEN a
student
is requesting attendees of an activity in the appWHEN the app hits the
/activities/:id/attendees
endpoint with a valid GET request, containing the path parameter::id
, a non-existent idTHEN the app should receive a status
404
AND the response headers'
code
parameter should contain "NotFoundException"AND the response headers'
message
parameter should contain "Activity not found"Scenario 3: GET request is unsuccessful due to zero attendees
GIVEN a
student
is requesting attendees of an activity in the appAND no attendees of that activity exist yet
WHEN the app hits the
/activities/:id/attendees
endpoint with a valid GET request, containing the path parameter::id
THEN the app should receive a status
404
AND the response headers'
code
parameter should contain "NotFoundException"AND the response headers'
message
parameter should contain "Activity attendees not found"Scenario 4: GET request is unauthorized
GIVEN a
student
is requesting attendees of an activity in the appWHEN the app hits the
/activities/:id/attendees
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: