@@ -103,23 +103,37 @@ Feature: Error handling
103
103
And the JSON node "hydra:description" should be equal to "Update is not allowed for this operation."
104
104
And the JSON node "trace" should exist
105
105
106
- Scenario : Get an error during update of an existing relation with a non-allowed update operation
106
+ @createSchema
107
+ Scenario : Do not get an error during update of an existing relation with a non-allowed update operation
108
+ When I add "Content-Type" header equal to "application/ld+json"
109
+ Given I send a "POST" request to "/related_dummies" with body:
110
+ """
111
+ {
112
+ "@type": "https://schema.org/Product",
113
+ "symfony": "laravel"
114
+ }
115
+ """
116
+ Then the response status code should be 201
117
+ And the response should be in JSON
118
+ And the JSON node "@id" should be equal to "/related_dummies/1"
119
+ And the JSON node "symfony" should be equal to "laravel"
120
+
107
121
When I add "Content-Type" header equal to "application/ld+json"
108
122
And I send a "POST" request to "/relation_embedders" with body:
109
123
"""
110
124
{
111
125
"anotherRelated": {
112
- "@id": "/related_dummies/2 ",
126
+ "@id": "/related_dummies/1 ",
113
127
"@type": "https://schema.org/Product",
114
128
"symfony": "phalcon"
115
129
}
116
130
}
117
131
"""
118
- Then the response status code should be 400
132
+ Then the response status code should be 201
119
133
And the response should be in JSON
120
134
And the header "Content-Type" should be equal to "application/ld+json; charset=utf-8"
121
- And the JSON node "@context" should be equal to "/contexts/Error "
122
- And the JSON node "@type" should be equal to "hydra:Error "
123
- And the JSON node "hydra:title " should be equal to "An error occurred "
124
- And the JSON node "hydra:description " should be equal to "Update is not allowed for this operation. "
125
- And the JSON node "trace " should exist
135
+ And the JSON node "@context" should be equal to "/contexts/RelationEmbedder "
136
+ And the JSON node "@type" should be equal to "RelationEmbedder "
137
+ And the JSON node "@id " should be equal to "/relation_embedders/1 "
138
+ And the JSON node "anotherRelated.@id " should be equal to "/related_dummies/1 "
139
+ And the JSON node "anotherRelated.symfony " should be equal to "phalcon"
0 commit comments