@@ -23,6 +23,24 @@ Feature: Relations support
23
23
}
24
24
"""
25
25
26
+ Scenario : Create a dummy friend
27
+ When I send a "POST" request to "/dummy_friends" with body:
28
+ """
29
+ {"name": "Zoidberg"}
30
+ """
31
+ Then the response status code should be 201
32
+ And the response should be in JSON
33
+ And the header "Content-Type" should be equal to "application/ld+json"
34
+ And the JSON should be equal to:
35
+ """
36
+ {
37
+ "@context": "/contexts/DummyFriend",
38
+ "@id": "/dummy_friends/1",
39
+ "@type": "DummyFriend",
40
+ "name": "Zoidberg"
41
+ }
42
+ """
43
+
26
44
Scenario : Create a related dummy
27
45
When I send a "POST" request to "/related_dummies" with body:
28
46
"""
@@ -42,12 +60,61 @@ Feature: Relations support
42
60
"name": null,
43
61
"dummyDate": null,
44
62
"thirdLevel": "/third_levels/1",
63
+ "relatedToDummyFriend": null,
45
64
"dummyBoolean": null,
46
65
"symfony": "symfony",
47
66
"age": null
48
67
}
49
68
"""
50
69
70
+ Scenario : Create a friend relationship
71
+ When I send a "POST" request to "/related_to_dummy_friends" with body:
72
+ """
73
+ {
74
+ "name": "Friends relation",
75
+ "dummyFriend": "/dummy_friends/1",
76
+ "relatedDummy": "/related_dummies/1"
77
+ }
78
+ """
79
+ Then the response status code should be 201
80
+ And the response should be in JSON
81
+ And the header "Content-Type" should be equal to "application/ld+json"
82
+ And the JSON should be equal to:
83
+ """
84
+ {
85
+ "@context": "/contexts/RelatedToDummyFriend",
86
+ "@id": "/related_to_dummy_friends/dummyFriend=1;relatedDummy=1",
87
+ "@type": "RelatedToDummyFriend",
88
+ "name": "Friends relation",
89
+ "dummyFriend": {
90
+ "@id": "/dummy_friends/1",
91
+ "@type": "DummyFriend",
92
+ "name": "Zoidberg"
93
+ }
94
+ }
95
+ """
96
+
97
+ Scenario : Get the relationship
98
+ When I send a "GET" request to "/related_to_dummy_friends/dummyFriend=1;relatedDummy=1"
99
+ And the response status code should be 200
100
+ And the response should be in JSON
101
+ And the header "Content-Type" should be equal to "application/ld+json"
102
+ And the JSON should be equal to:
103
+ """
104
+ {
105
+ "@context": "/contexts/RelatedToDummyFriend",
106
+ "@id": "/related_to_dummy_friends/dummyFriend=1;relatedDummy=1",
107
+ "@type": "RelatedToDummyFriend",
108
+ "name": "Friends relation",
109
+ "dummyFriend": {
110
+ "@id": "/dummy_friends/1",
111
+ "@type": "DummyFriend",
112
+ "name": "Zoidberg"
113
+ }
114
+ }
115
+ """
116
+
117
+
51
118
Scenario : Create a dummy with relations
52
119
When I send a "POST" request to "/dummies" with body:
53
120
"""
0 commit comments