The purpose of this project is to build a simple web (JSON over HTTP) API to manage tasks, following a test-driven development approach.
We want to ensure that the emphasis is on practicing all the test-driven development concepts covered by the course. Therefore, in building this simple API, we will focus on happy path scenarios only.
As a user (through a client of this web API)
I want to be able to retrieve all the tasks
So that I can plan and organise my day.
Given there are 2 tasks in our task management system
When I request to see their details via the GET /tasks
endpoint
Then I should get a 200 OK
HTTP response with:
[
{
"id": 1,
"title": "Contact checkout",
"description": "Inform the checkout team about the new version of our API.",
"completed": false
},
{
"id": 2,
"title": "Contract phase",
"description": "Prepare the contract phase of the old API.",
"completed": false
}
]
As a user (through a client of this web API)
I want to be able to create a new task as needed
So that I keep track of all the work to be done.
Given the details of a new task below
When I request to create a new task via the POST /tasks
endpoint
Then I should get a 201 CREATED
HTTP response.
{
"title": "Contract tests",
"description": "Write provider contract tests for the new version of our API.",
"completed": false
}
As a user (through a client of this web API)
I want to be able to edit the description of a task
So that I keep an accurate record of my tasks.
Given the new (partial) details of an existing task below
When I request to update a task via the PUT /tasks/{id}
endpoint
Then I should get a 204 NO CONTENT
HTTP response.
{
"title": "Contact checkout and customer service",
"description": "Inform the checkout and the customer service teams about the new version of our API."
}
As a user (through a client of this web API)
I want to be able to mark a task as done
When I have completed it.
Given the new partial details of an existing task below
When I request to complete a task via the PUT /tasks/{id}
endpoint
Then I should get a 204 NO CONTENT
HTTP response.
{
"completed": true
}
As a user (through a client of this web API)
I want to be able to delete a task
When it has become obsolete.
Given a task in our system has become obsolete
When I request to delete it via the DELETE /tasks/{id}
endpoint
Then I should get a 204 NO CONTENT
response.