You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ada-project-docs/wave_03.md
+60-4
Original file line number
Diff line number
Diff line change
@@ -22,14 +22,14 @@ The following route is required for wave 3.
22
22
- JSON's value of `true` is similar to Python's value of `True`, and `false` is similar to Python's `False`.
23
23
- JSON's value of `null` is similar to Python's value of `None`.
24
24
25
-
### Toggle Complete: Mark Complete on an Incomplete Task
25
+
### Mark Complete on an Incompleted Task
26
26
27
27
Given a task that has:
28
28
29
29
- An id `1`
30
30
- A `completed_at` attribute with a `null` value
31
31
32
-
when I send a `PATCH` request to `/tasks/1/complete`,
32
+
when I send a `PATCH` request to `/tasks/1/mark_complete`,
33
33
34
34
then the task is updated, so that its `completed_at` value is the current date, and I get this response:
35
35
@@ -46,14 +46,14 @@ then the task is updated, so that its `completed_at` value is the current date,
46
46
}
47
47
```
48
48
49
-
### Toggle Complete: Mark Complete on an Incomplete Task
49
+
### Mark Incomplete on a Completed Task
50
50
51
51
Given a task that has:
52
52
53
53
- An id `1`
54
54
- A `completed_at` attribute with a datetime value
55
55
56
-
when I send a `PATCH` request to `/tasks/1/complete`,
56
+
when I send a `PATCH` request to `/tasks/1/mark_incomplete`,
57
57
58
58
then the task is updated, so that its `completed_at` value is `null`/`None`, and I get this response:
59
59
@@ -69,3 +69,59 @@ then the task is updated, so that its `completed_at` value is `null`/`None`, and
69
69
}
70
70
}
71
71
```
72
+
73
+
### Mark Complete on a Completed Task
74
+
75
+
Given a task that has:
76
+
77
+
- An id `1`
78
+
- A `completed_at` attribute with a datetime value
79
+
80
+
when I send a `PATCH` request to `/tasks/1/mark_complete`,
81
+
82
+
then I want this to behave exactly like `/tasks/1/mark_complete` for an incomplete task. The task is updated, so that its `completed_at` value is the current date, and I get this response:
83
+
84
+
`200 OK`
85
+
86
+
```json
87
+
{
88
+
"task": {
89
+
"id": 1,
90
+
"title": "Go on my daily walk 🏞",
91
+
"description": "Notice something new every day",
92
+
"is_complete": true
93
+
}
94
+
}
95
+
```
96
+
97
+
### Mark Incomplete on an Incompleted Task
98
+
99
+
Given a task that has:
100
+
101
+
- An id `1`
102
+
- A `completed_at` attribute with a `null` value
103
+
104
+
when I send a `PATCH` request to `/tasks/1/mark_incomplete`,
105
+
106
+
then I want this to behave exactly like `/tasks/1/mark_complete` for an incomplete task. Its `completed_at` value remains as `null`/`None`, and I get this response:
107
+
108
+
`200 OK`
109
+
110
+
```json
111
+
{
112
+
"task": {
113
+
"id": 1,
114
+
"title": "Go on my daily walk 🏞",
115
+
"description": "Notice something new every day",
116
+
"is_complete": false
117
+
}
118
+
}
119
+
```
120
+
121
+
## Mark Complete and Mark Incomplete for Missing Tasks
122
+
123
+
Given that there are no tasks with the ID `1`,
124
+
125
+
When I send a `PATCH` request to `/tasks/1/mark_complete` or a `PATCH` request `/tasks/1/mark_incomplete`,
126
+
127
+
Then I get a `404 Not Found`, with no response body.
Copy file name to clipboardExpand all lines: ada-project-docs/wave_04.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ To complete this wave, follow these steps:
15
15
1. Setup a Slack workspace and create a Slackbot with the right permissions, and get a Slackbot API key
16
16
1. Verify that your Slackbot works using the Slack Tester
17
17
1. Verify that your Slackbot works using Postman
18
-
1. Modify the `/tasks/<task_id>/complete` route to make a call to the Slack API
18
+
1. Modify the `/tasks/<task_id>/mark_complete` route to make a call to the Slack API
19
19
1. Use Postman to verify your work
20
20
21
21
### Setup a Slack Workspace
@@ -95,15 +95,15 @@ Let's verify that this API call works even in Postman!
95
95
96
96
- We could put in the token as a query param. However, the Slack API documentation states that it prefers API keys to be sent in the "Authorization" request header.
97
97
98
-
### Modify `/tasks/<task_id>/complete` to Call the Slack API: Toggle Complete
98
+
### Modify `/tasks/<task_id>/mark_complete` to Call the Slack API
99
99
100
100
Given a task that has:
101
101
102
102
- An id `1`
103
103
- A `title` attribute with the value `"My Beautiful Task"`
104
104
- A `completed_at` attribute with a `null` value
105
105
106
-
when I send a `PATCH` request to `/tasks/1/complete`,
106
+
when I send a `PATCH` request to `/tasks/1/mark_complete`,
107
107
108
108
then a Slack message is immediately sent to the channel `task-notifications` in the configured Slack workspace, with the text `"Someone just completed the task My Beautiful Task"`. "My Beautiful Task" should be the title of the task.
0 commit comments