As Kenny, a busy front end engineer I need to be able to send a PUT request with a JSON request body (the activity to update) to the API so that I can make a simple form that allows my user to edit an activity.
As Norman, a Tech Lead working across lots of projects I need to be able to depend on conventions like: the response object always containing a key called data or error, or the status code being an accurate indication of the success/failure (and reason) of the request.
Then the the request should succeed, responding with the correct status code and an array of User Activity objects in the response body (response.data).
### Tasks for User Story 3
- [x] Define User Activity Object somewhere
- [x] Create '/activities' GET route
- [x] Respond with correct status code (200)
- [x] Respond with reponse.body having an Array of User Acitivity Objects
- [x] Test criteria for /acitivties route and JSON response
Description:
As Kenny, a busy front end engineer I need to be able to send a PUT request with a JSON request body (the activity to update) to the API so that I can make a simple form that allows my user to edit an activity.
As Norman, a Tech Lead working across lots of projects I need to be able to depend on conventions like: the response object always containing a key called data or error, or the status code being an accurate indication of the success/failure (and reason) of the request.
Acceptance Criteria:
Given I am a developer who has the Activity API running, When I make a GET request to “http://localhost:3000/activities”
Then the the request should succeed, responding with the correct status code and an array of User Activity objects in the response body (response.data).