1
1
Feature : Puzzle Revoke
2
2
Scenario : PUT /event/puzzle/revoke to revoke attendee puzzle
3
- Given there have some attendees
3
+ Given there have some booths
4
+ | token | name | event_id |
5
+ | 1024914b -ee65 -4728 -b687 -8341f5affa89 | COSCUP | SITCON |
6
+ And event "SITCON" have a puzzle config
7
+ """
8
+ {
9
+ "pieces": {
10
+ "=": 1
11
+ }
12
+ }
13
+ """
14
+ And there have some attendees
4
15
| token | event_id | display_name |
5
16
| f185f505 -d8c0 -43ce -9e7b -bb9e8909072d | SITCON | Aotoki |
6
- When I make a PUT request to "/event/puzzle/revoke?token=f185f505-d8c0-43ce-9e7b-bb9e8909072d" :
17
+ When I make a POST request to "/event/puzzle/deliver?token=1024914b-ee65-4728-b687-8341f5affa89&event_id=SITCON" :
18
+ """
19
+ {
20
+ "receiver": "f185f505-d8c0-43ce-9e7b-bb9e8909072d"
21
+ }
22
+ """
23
+ And I make a PUT request to "/event/puzzle/revoke?token=f185f505-d8c0-43ce-9e7b-bb9e8909072d&event_id=SITCON" :
7
24
"""
8
25
{}
9
26
"""
@@ -14,3 +31,80 @@ Feature: Puzzle Revoke
14
31
}
15
32
"""
16
33
And the response status should be 200
34
+
35
+ Scenario : PUT /event/puzzle/revoke to revoke attendee can see revoked puzzle
36
+ Given there have some booths
37
+ | token | name | event_id |
38
+ | 1024914b -ee65 -4728 -b687 -8341f5affa89 | COSCUP | SITCON |
39
+ And event "SITCON" have a puzzle config
40
+ """
41
+ {
42
+ "pieces": {
43
+ "=": 1
44
+ }
45
+ }
46
+ """
47
+ And there have some attendees
48
+ | token | event_id | display_name |
49
+ | f185f505 -d8c0 -43ce -9e7b -bb9e8909072d | SITCON | Aotoki |
50
+ When I make a POST request to "/event/puzzle/deliver?token=1024914b-ee65-4728-b687-8341f5affa89&event_id=SITCON" :
51
+ """
52
+ {
53
+ "receiver": "f185f505-d8c0-43ce-9e7b-bb9e8909072d"
54
+ }
55
+ """
56
+ And I make a PUT request to "/event/puzzle/revoke?token=f185f505-d8c0-43ce-9e7b-bb9e8909072d&event_id=SITCON" :
57
+ """
58
+ {}
59
+ """
60
+ And I make a GET request to "/event/puzzle?token=f185f505-d8c0-43ce-9e7b-bb9e8909072d&event_id=SITCON"
61
+ Then the response json should be:
62
+ """
63
+ {
64
+ "user_id": "Aotoki",
65
+ "puzzles": ["="],
66
+ "deliverers": ["COSCUP"],
67
+ "valid": 1693065600,
68
+ "coupon": 0
69
+ }
70
+ """
71
+ And the response status should be 200
72
+
73
+ Scenario : PUT /event/puzzle/revoke to revoke attendee can see stats changed
74
+ Given there have some booths
75
+ | token | name | event_id |
76
+ | 1024914b -ee65 -4728 -b687 -8341f5affa89 | COSCUP | SITCON |
77
+ And event "SITCON" have a puzzle config
78
+ """
79
+ {
80
+ "pieces": {
81
+ "=": 1
82
+ }
83
+ }
84
+ """
85
+ And there have some attendees
86
+ | token | event_id | display_name |
87
+ | f185f505 -d8c0 -43ce -9e7b -bb9e8909072d | SITCON | Aotoki |
88
+ When I make a POST request to "/event/puzzle/deliver?token=1024914b-ee65-4728-b687-8341f5affa89&event_id=SITCON" :
89
+ """
90
+ {
91
+ "receiver": "f185f505-d8c0-43ce-9e7b-bb9e8909072d"
92
+ }
93
+ """
94
+ And I make a PUT request to "/event/puzzle/revoke?token=f185f505-d8c0-43ce-9e7b-bb9e8909072d&event_id=SITCON" :
95
+ """
96
+ {}
97
+ """
98
+ And I make a GET request to "/event/puzzle/dashboard?event_id=SITCON"
99
+ Then the response json should be:
100
+ """
101
+ [
102
+ {
103
+ "puzzle": "=", "quantity": 1, "currency": 0
104
+ },
105
+ {
106
+ "puzzle": "total", "quantity": 1, "currency": 0
107
+ }
108
+ ]
109
+ """
110
+ And the response status should be 200
0 commit comments