-
Notifications
You must be signed in to change notification settings - Fork 0
/
test-cases.http
91 lines (58 loc) · 2 KB
/
test-cases.http
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
### Create leaderboard
GET {{host}}/api/v1/leaderboards/new
> {%
client.global.set("secret", response.body.secret);
client.global.set("lb", response.body.id);
%}
### Create simple score
POST {{host}}/api/v1/scores/{{lb}}/{{secret}}/add/yogurt/1000/
Content-Type: application/json
### Create simple score 2
POST {{host}}/api/v1/scores/{{lb}}/{{secret}}/add/kib erptah/1100/
Content-Type: application/json
### Create simple score 3
POST {{host}}/api/v1/scores/{{lb}}/{{secret}}/add/iorving/900/
Content-Type: application/json
### Create simple score 4
POST {{host}}/api/v1/scores/{{lb}}/{{secret}}/add/iorving/1500/
Content-Type: application/json
### Create simple score 5
POST {{host}}/api/v1/scores/{{lb}}/{{secret}}/add/seryiza/2000/
Content-Type: application/json
### Check scores
GET {{host}}/api/v1/scores/{{lb}}/10
Content-Type: application/json
### Clear scores
DELETE {{host}}/api/v1/scores/{{lb}}/{{secret}}
Content-Type: application/json
### Check first 3 scores after clear
GET {{host}}/api/v1/scores/{{lb}}/3
Content-Type: application/json
### Delete seryiza score
DELETE {{host}}/api/v1/scores/{{lb}}/{{secret}}/by/seryiza
Content-Type: application/json
### Get yogurt score
GET {{host}}/api/v1/scores/{{lb}}/by/yogurt
Content-Type: application/json
### Add time to yogurt score
POST {{host}}/api/v1/scores/{{lb}}/{{secret}}/add/yogurt/900/3.4
Content-Type: application/json
### Check first 3 scores after delete
GET {{host}}/api/v1/scores/{{lb}}/10
Content-Type: application/json
### try to create with wrong name
POST {{host}}/api/v1/scores/{{lb}}/{{secret}}/add/фывфы/1000/
Content-Type: application/json
> {%
client.test("bad request", function () {
client.assert(response.status === 400, "Response status is not 400");
})
%}
### try to access unexisted leaderboard id
GET {{host}}/api/v1/scores/9999999/10
Content-Type: application/json
> {%
client.test("not found", function () {
client.assert(response.status === 404, "Response status is not 404");
})
%}