[POST] A New Post #140
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 create posts, so that I can get reactions on them.Acceptance Criteria
GIVEN an
student
is creating a post in the appWHEN the app hits the
/posts
endpoint with a valid POST request, containing:body
textprivacy
enum('public','private','limited')author_erp
varchar(5),posted_at
datetimeresources
array, where each item contains:resource_url
varchar(150)resource_type
enum('image','video')THEN the app should receive a status
201
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: POST request is successful
/posts
endpoint withauthor_erp
== erp instudent
account token and ensure a201
status code is returned.id
returned by the response in a subsequent GET request to/posts/:id
endpoint and ensure a200
status code is returned./posts/:id
endpoint and ensure a200
status code is returned.Scenario 2: POST request is incorrect
/posts
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 3: POST request is forbidden
/posts
endpoint withauthor_erp
!= erp instudent
account token.403
forbidden status code.code
parameter should contain "ForbiddenException"Scenario 4: POST request is unauthorized
/posts
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: