@@ -262,16 +262,14 @@ Feature: Relations support
262
262
"@id": "/relation_embedders/1",
263
263
"@type": "RelationEmbedder",
264
264
"krondstadt": "Krondstadt",
265
- "anotherRelated": null,
266
265
"related": {
267
266
"@id": "/related_dummies/1",
268
267
"@type": "https://schema.org/Product",
269
268
"symfony": "symfony",
270
269
"thirdLevel": {
271
270
"@id": "/third_levels/1",
272
271
"@type": "ThirdLevel",
273
- "level": 3,
274
- "fourthLevel": null
272
+ "level": 3
275
273
}
276
274
}
277
275
}
@@ -300,10 +298,8 @@ Feature: Relations support
300
298
"anotherRelated": {
301
299
"@id": "/related_dummies/2",
302
300
"@type": "https://schema.org/Product",
303
- "symfony": "laravel",
304
- "thirdLevel": null
305
- },
306
- "related": null
301
+ "symfony": "laravel"
302
+ }
307
303
}
308
304
"""
309
305
@@ -330,10 +326,8 @@ Feature: Relations support
330
326
"anotherRelated": {
331
327
"@id": "/related_dummies/3",
332
328
"@type": "https://schema.org/Product",
333
- "symfony": "laravel2",
334
- "thirdLevel": null
335
- },
336
- "related": null
329
+ "symfony": "laravel2"
330
+ }
337
331
}
338
332
"""
339
333
@@ -389,10 +383,8 @@ Feature: Relations support
389
383
"anotherRelated": {
390
384
"@id": "/related_dummies/2",
391
385
"@type": "https://schema.org/Product",
392
- "symfony": "API Platform",
393
- "thirdLevel": null
394
- },
395
- "related": null
386
+ "symfony": "API Platform"
387
+ }
396
388
}
397
389
"""
398
390
@@ -545,3 +537,58 @@ Feature: Relations support
545
537
]
546
538
}
547
539
"""
540
+
541
+ @createSchema
542
+ Scenario : Patch the relation
543
+ When I add "Content-Type" header equal to "application/ld+json"
544
+ And I send a "POST" request to "/relation_embedders" with body:
545
+ """
546
+ {
547
+ "anotherRelated": {
548
+ "symfony": "laravel"
549
+ }
550
+ }
551
+ """
552
+ Then the response status code should be 201
553
+ And the response should be in JSON
554
+ And the header "Content-Type" should be equal to "application/ld+json; charset=utf-8"
555
+ And the JSON should be equal to:
556
+ """
557
+ {
558
+ "@context": "/contexts/RelationEmbedder",
559
+ "@id": "/relation_embedders/1",
560
+ "@type": "RelationEmbedder",
561
+ "krondstadt": "Krondstadt",
562
+ "anotherRelated": {
563
+ "@id": "/related_dummies/1",
564
+ "@type": "https://schema.org/Product",
565
+ "symfony": "laravel"
566
+ }
567
+ }
568
+ """
569
+ Then I add "Content-Type" header equal to "application/merge-patch+json"
570
+ And I send a "PATCH" request to "/relation_embedders/1" with body:
571
+ """
572
+ {
573
+ "anotherRelated": {
574
+ "symfony": "laravel2"
575
+ }
576
+ }
577
+ """
578
+ Then the response status code should be 200
579
+ And the response should be in JSON
580
+ And the header "Content-Type" should be equal to "application/ld+json; charset=utf-8"
581
+ And the JSON should be equal to:
582
+ """
583
+ {
584
+ "@context": "/contexts/RelationEmbedder",
585
+ "@id": "/relation_embedders/1",
586
+ "@type": "RelationEmbedder",
587
+ "krondstadt": "Krondstadt",
588
+ "anotherRelated": {
589
+ "@id": "/related_dummies/1",
590
+ "@type": "https://schema.org/Product",
591
+ "symfony": "laravel2"
592
+ }
593
+ }
594
+ """
0 commit comments