[PATCH] An Activity Attendee #99
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 update involvement on an activity, so that I can update whether I'm attending or not.Acceptance Criteria
GIVEN an
student
is updating his involvement on an activity in the appWHEN the app hits the
/activities/:id/attendees/:student_erp
endpoint with a valid PATCH request, containing the path parameter::id
, the unique id of the entity being editedstudent_erp
, the unique id of the entity being removedAND any of the following body parameters:
involvement_type
enum('going','interested','will_try')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 (Owner)
/activities/:id/attendees/:student_erp
endpoint withstudent_erp
== erp instudent
account token./activities/:id/attendees/:student_erp
endpoint should return a status code200
/activities/:id/attendees/:student_erp
endpoint to reverse the change and ensure status code200
is returned.Scenario 2: PATCH request is successful (Admin)
/activities/:id/attendees/:student_erp
endpoint using anadmin
account token./activities/:id/attendees/:student_erp
endpoint should return a status code200
/activities/:id/attendees/:student_erp
endpoint to reverse the change and ensure status code200
is returned.Scenario 3: PATCH request is unsuccessful due to unknown activity_id
/activities/:id/attendees/:student_erp
endpoint containing a non-existent:id
.404
status code is returned.code
parameter should contain "NotFoundException".message
parameter should contain "Activity attendee not found"Scenario 4: PATCH request is unsuccessful due to unknown student erp
/activities/:id/attendees/:student_erp
endpoint containing a non-existenterp
.404
status code is returned.code
parameter should contain "NotFoundException".message
parameter should contain "Activity attendee not found"Scenario 5: PATCH request is incorrect
/activities/:id/attendees/:student_erp
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 parameterScenario 6: PATCH request is forbidden
/activities/:id/attendees/:student_erp
endpoint withstudent_erp
!= erp instudent
account token.403
forbidden status code.code
parameter should contain "ForbiddenException"Scenario 7: PATCH request is unauthorized
/activities/:id/attendees/:student_erp
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: