[POST] A Reaction On A Post #141
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 select reaction on a post, so that I can show my emotion.Acceptance Criteria
GIVEN an
student
is choosing a reaction on a post in the appWHEN the app hits the
/posts/:id/reactions
endpoint with a valid POST request, containing:reaction_type_id
int(10),student_erp
varchar(5)reacted_at
datetimeTHEN the app should receive a status
201
AND in the response, the following information should be returned:
Sample Request/Sample Response
Resources
Dev Notes
Use the :id in path parameter as the post_id for the body
Testing Notes
Scenario 1: POST request is successful
/posts/:id/reactions
endpoint and ensure a201
status code is returned./posts/:id/reactions/:student_erp
endpoint and ensure a200
status code is returned./posts/:id/reactions/:student_erp
endpoint and ensure a200
status code is returned.Scenario 2: POST request is unsuccessful due to unknown post id
/posts/:id/reactions
endpoint containing a non-existent:id
.512
status code is returned.code
parameter should contain "ForeignKeyViolationException"Scenario 3: POST request is incorrect
/posts/:id/reactions
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 4: POST request is forbidden
/posts/:id/reactions
endpoint withstudent_erp
!= erp instudent
account token.403
forbidden status code.code
parameter should contain "ForbiddenException"Scenario 5: POST request is unauthorized
/posts/:id/reactions
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: