@@ -249,16 +249,15 @@ Feature: Relations support
249
249
}
250
250
"""
251
251
252
- @wip
253
252
Scenario : Create an existing relation
254
253
When I send a "POST" request to "/relation_embedders" with body:
255
254
"""
256
- {
257
- "anotherRelated": {
258
- "symfony": "laravel"
259
- }
255
+ {
256
+ "anotherRelated": {
257
+ "symfony": "laravel"
260
258
}
261
- """
259
+ }
260
+ """
262
261
Then the response status code should be 201
263
262
And the response should be in JSON
264
263
And the header "Content-Type" should be equal to "application/ld+json"
@@ -279,16 +278,31 @@ Feature: Relations support
279
278
}
280
279
"""
281
280
281
+ Scenario : Post a wrong relation
282
+ When I send a "POST" request to "/relation_embedders" with body:
283
+ """
284
+ {
285
+ "anotherRelated": {
286
+ "@id": "/related_dummies/123",
287
+ "@type": "https://schema.org/Product",
288
+ "symfony": "phalcon"
289
+ }
290
+ }
291
+ """
292
+ Then the response status code should be 400
293
+ And the response should be in JSON
294
+ And the header "Content-Type" should be equal to "application/ld+json"
295
+
282
296
Scenario : Update an embedded relation
283
297
When I send a "PUT" request to "/relation_embedders/2" with body:
284
298
"""
285
- {
286
- "anotherRelated": {
287
- "@id": "/related_dummies/2",
288
- "symfony": "API Platform"
289
- }
299
+ {
300
+ "anotherRelated": {
301
+ "@id": "/related_dummies/2",
302
+ "symfony": "API Platform"
290
303
}
291
- """
304
+ }
305
+ """
292
306
Then the response status code should be 200
293
307
And the response should be in JSON
294
308
And the header "Content-Type" should be equal to "application/ld+json"
@@ -313,14 +327,14 @@ Feature: Relations support
313
327
Scenario : Update an existing relation
314
328
When I send a "POST" request to "/relation_embedders" with body:
315
329
"""
316
- {
317
- "anotherRelated": {
318
- "@id": "/related_dummies/2",
319
- "@type": "https://schema.org/Product",
320
- "symfony": "phalcon"
321
- }
330
+ {
331
+ "anotherRelated": {
332
+ "@id": "/related_dummies/2",
333
+ "@type": "https://schema.org/Product",
334
+ "symfony": "phalcon"
322
335
}
323
- """
336
+ }
337
+ """
324
338
Then the response status code should be 201
325
339
And the response should be in JSON
326
340
And the header "Content-Type" should be equal to "application/ld+json"
0 commit comments