@@ -22,12 +22,67 @@ Feature: Using custom normalized entity
22
22
"@context": "/contexts/CustomNormalizedDummy",
23
23
"@id": "/custom_normalized_dummies/1",
24
24
"@type": "CustomNormalizedDummy",
25
+ "id": 1,
25
26
"name": "My Dummy",
26
27
"alias": "My alias"
27
28
}
28
29
"""
29
30
30
- Scenario : Get a resource
31
+ Scenario : Create a resource with a custom normalized dummy
32
+ When I add "Content-Type" header equal to "application/json"
33
+ When I add "Accept" header equal to "application/json"
34
+ And I send a "POST" request to "/related_normalized_dummies" with body:
35
+ """
36
+ {
37
+ "name": "My Dummy"
38
+ }
39
+ """
40
+ Then the response status code should be 201
41
+ And the response should be in JSON
42
+ And the header "Content-Type" should be equal to "application/json; charset=utf-8"
43
+ And the JSON should be equal to:
44
+ """
45
+ {
46
+ "id": 1,
47
+ "name": "My Dummy",
48
+ "customNormalizedDummy": []
49
+ }
50
+ """
51
+
52
+ Scenario : Create a resource with a custom normalized dummy and an id
53
+ When I add "Content-Type" header equal to "application/json"
54
+ When I add "Accept" header equal to "application/json"
55
+ And I send a "PUT" request to "/related_normalized_dummies/1" with body:
56
+ """
57
+ {
58
+ "name": "My Dummy",
59
+ "customNormalizedDummy":[{
60
+ "@context": "/contexts/CustomNormalizedDummy",
61
+ "@id": "/custom_normalized_dummies/1",
62
+ "@type": "CustomNormalizedDummy",
63
+ "id": 1,
64
+ "name": "My Dummy"
65
+ }]
66
+ }
67
+ """
68
+ Then the response status code should be 200
69
+ And the response should be in JSON
70
+ And the header "Content-Type" should be equal to "application/json; charset=utf-8"
71
+ And the JSON should be equal to:
72
+ """
73
+ {
74
+ "id": 1,
75
+ "name": "My Dummy",
76
+ "customNormalizedDummy":[{
77
+ "id": 1,
78
+ "name": "My Dummy",
79
+ "alias": "My alias"
80
+ }]
81
+ }
82
+ """
83
+
84
+
85
+ Scenario : Get a custom normalized dummy resource
31
86
When I send a "GET" request to "/custom_normalized_dummies/1"
32
87
Then the response status code should be 200
33
88
And the response should be in JSON
@@ -38,6 +93,7 @@ Feature: Using custom normalized entity
38
93
"@context": "/contexts/CustomNormalizedDummy",
39
94
"@id": "/custom_normalized_dummies/1",
40
95
"@type": "CustomNormalizedDummy",
96
+ "id": 1,
41
97
"name": "My Dummy",
42
98
"alias": "My alias"
43
99
}
@@ -58,6 +114,7 @@ Feature: Using custom normalized entity
58
114
{
59
115
"@id": "/custom_normalized_dummies/1",
60
116
"@type": "CustomNormalizedDummy",
117
+ "id": 1,
61
118
"name": "My Dummy",
62
119
"alias": "My alias"
63
120
}
@@ -83,6 +140,7 @@ Feature: Using custom normalized entity
83
140
"@context": "/contexts/CustomNormalizedDummy",
84
141
"@id": "/custom_normalized_dummies/1",
85
142
"@type": "CustomNormalizedDummy",
143
+ "id": 1,
86
144
"name": "My Dummy modified",
87
145
"alias": "My alias"
88
146
}
0 commit comments