@@ -190,5 +190,87 @@ Feature: Events
190
190
And the JSON node "organizer.name" should be equal to "Damage, Inc."
191
191
And the JSON node "organizer.@id" should be equal to "/api/organizers/4"
192
192
193
+ Scenario : Create an event with existing partner organizers
194
+ When I authenticate as "api-write"
195
+ And I add "Content-Type" header equal to "application/ld+json"
196
+ And I add "Accept" header equal to "application/ld+json"
197
+ And I send a "POST" request to "/api/events" with body:
198
+ """
199
+ {
200
+ "name": "The first event (again)",
201
+ "organizer": {
202
+ "name": "The organizer",
203
+
204
+ "url": "https://example.com/organizer"
205
+ },
206
+ "partnerOrganizers": [
207
+ {
208
+ "name": "The First Partner",
209
+
210
+ "url": "https://partner-1.com/organizer"
211
+ },
212
+ {
213
+ "name": "The Second Partner",
214
+
215
+ "url": "https://partner-2.com/organizer"
216
+ }
217
+ ],
218
+ "occurrences": [ {
219
+ "startDate": "2000-01-01T00:00:00+00:00",
220
+ "endDate": "2001-01-01T00:00:00+00:00"
221
+ } ]
222
+ }
223
+ """
224
+ Then the response status code should be 201
225
+ And the response should be in JSON
226
+ And the header "Content-Type" should be equal to "application/ld+json; charset=utf-8"
227
+ And the JSON node "organizer.name" should be equal to "The organizer"
228
+ And the JSON node "organizer.@id" should be equal to "/api/organizers/1"
229
+ And the JSON node "partnerOrganizers" should have 2 elements
230
+ And the JSON node "partnerOrganizers[0].name" should be equal to "The First Partner"
231
+ And the JSON node "partnerOrganizers[0].@id" should be equal to "/api/organizers/2"
232
+ And the JSON node "partnerOrganizers[1].name" should be equal to "The Second Partner"
233
+ And the JSON node "partnerOrganizers[1].@id" should be equal to "/api/organizers/3"
234
+
235
+ Scenario : Create an event with existing partner organizers
236
+ When I authenticate as "api-write"
237
+ And I add "Content-Type" header equal to "application/ld+json"
238
+ And I add "Accept" header equal to "application/ld+json"
239
+ And I send a "POST" request to "/api/events" with body:
240
+ """
241
+ {
242
+ "name": "The first event (again)",
243
+ "organizer": {
244
+ "name": "The organizer",
245
+
246
+ "url": "https://example.com/organizer"
247
+ },
248
+ "partnerOrganizers": [
249
+ {
250
+ "@id": "/api/organizers/2"
251
+ },
252
+ {
253
+ "name": "The Second Partner",
254
+
255
+ "url": "https://partner-2.com/organizer"
256
+ }
257
+ ],
258
+ "occurrences": [ {
259
+ "startDate": "2000-01-01T00:00:00+00:00",
260
+ "endDate": "2001-01-01T00:00:00+00:00"
261
+ } ]
262
+ }
263
+ """
264
+ Then the response status code should be 201
265
+ And the response should be in JSON
266
+ And the header "Content-Type" should be equal to "application/ld+json; charset=utf-8"
267
+ And the JSON node "organizer.name" should be equal to "The organizer"
268
+ And the JSON node "organizer.@id" should be equal to "/api/organizers/1"
269
+ And the JSON node "partnerOrganizers" should have 2 elements
270
+ And the JSON node "partnerOrganizers[0].name" should be equal to "The First Partner"
271
+ And the JSON node "partnerOrganizers[0].@id" should be equal to "/api/organizers/2"
272
+ And the JSON node "partnerOrganizers[1].name" should be equal to "The Second Partner"
273
+ And the JSON node "partnerOrganizers[1].@id" should be equal to "/api/organizers/3"
274
+
193
275
@dropSchema
194
276
Scenario : Drop schema
0 commit comments