-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcities.test.js
More file actions
53 lines (50 loc) · 965 Bytes
/
Copy pathcities.test.js
File metadata and controls
53 lines (50 loc) · 965 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
new HTTPTest("Create city (Sydney)")
.actual("/cities", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: {
"name": "Sydney", "country": "Australia"
}
})
.expected({
status: 200,
body: 3
});
new HTTPTest("Get specific city (Amsterdam)")
.actual("/cities/0")
.expected({
status: 200,
body: {
"name": "Amsterdam", "country": "Netherlands"
}
});
new HTTPTest("Get non-existing city")
.actual("/cities/100")
.expected({
status: 404
});
new HTTPTest("Get all cities")
.actual("/cities")
.expected({
status: 200,
body: [
{
"name": "Amsterdam",
"country": "Netherlands"
},
{
"name": "New York",
"country": "USA"
},
{
"name": "Tokyo",
"country": "Japan"
},
{
"name": "Sydney",
"country": "Australia"
}
]
});