-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcalendar_events_crud.yml
90 lines (81 loc) · 2.74 KB
/
calendar_events_crud.yml
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
---
requires:
serverless: true
stack: true
---
teardown:
- do:
ml.delete_calendar: { calendar_id: "events" }
- do:
ml.delete_calendar: { calendar_id: "events-2" }
---
"calendar events crud":
- do:
ml.put_calendar: { calendar_id: "events" }
- do:
ml.post_calendar_events:
calendar_id: "events"
body: >
{
"events" : [
{ "description": "event 1", "start_time": "2017-12-01T00:00:00Z", "end_time": "2017-12-02T00:00:00Z", "calendar_id": "events" },
{ "description": "event 2", "start_time": "2017-12-05T00:00:00Z", "end_time": "2017-12-06T00:00:00Z", "calendar_id": "events" },
{ "description": "event 3", "start_time": "2017-12-12T00:00:00Z", "end_time": "2017-12-13T00:00:00Z", "calendar_id": "events" },
{ "description": "event 4", "start_time": "2017-12-12T00:00:00Z", "end_time": "2017-12-15T00:00:00Z", "calendar_id": "events" }]
}
- do:
ml.get_calendar_events:
calendar_id: "events"
- length: { events: 4 }
- match: { events.0.description: "event 1" }
- match: { events.1.description: "event 2" }
- match: { events.2.description: "event 3" }
- match: { events.3.description: "event 4" }
- is_true: events.0.event_id
- set: { events.0.event_id: event_1_id }
- do:
ml.get_calendar_events:
calendar_id: "events"
from: 1
size: 2
- length: { events: 2 }
- match: { events.0.description: "event 2" }
- match: { events.1.description: "event 3" }
- do:
ml.get_calendar_events:
calendar_id: "events"
end: "2017-12-12T00:00:00Z"
- length: { events: 2 }
- match: { events.0.description: "event 1" }
- match: { events.1.description: "event 2" }
- do:
ml.get_calendar_events:
calendar_id: "events"
start: "2017-12-05T03:00:00Z"
- length: { events: 3 }
- match: { events.0.description: "event 2" }
- match: { events.1.description: "event 3" }
- match: { events.2.description: "event 4" }
- do:
ml.get_calendar_events:
calendar_id: "events"
start: "2017-12-02T00:00:00Z"
end: "2017-12-12T00:00:00Z"
- length: { events: 1 }
- match: { events.0.description: "event 2" }
- do:
ml.put_calendar:
calendar_id: "events-2"
- do:
ml.post_calendar_events:
calendar_id: "events-2"
body: >
{
"events" : [
{ "description": "event 21", "start_time": "2017-12-02T00:00:00Z", "end_time": "2017-12-02T05:00:00Z"},
{ "description": "event 22", "start_time": "2017-12-25T00:00:00Z", "end_time": "2017-12-26T00:00:00Z"}]
}
- do:
ml.delete_calendar_event:
calendar_id: "events"
event_id: $event_1_id