@@ -4,8 +4,9 @@ Feature: Boolean filter on collections
4
4
I need to retrieve collections with boolean value
5
5
6
6
@createSchema
7
- Scenario : Get collection by dummyBoolean false
7
+ Scenario : Get collection by dummyBoolean true
8
8
Given there is "15" dummy objects with dummyBoolean true
9
+ And there is "10" dummy objects with dummyBoolean false
9
10
When I send a "GET" request to "/dummies?dummyBoolean=true"
10
11
Then the response status code should be 200
11
12
And the response should be in JSON
@@ -34,12 +35,16 @@ Feature: Boolean filter on collections
34
35
}
35
36
},
36
37
"hydra:view": {
37
- "@id": {"pattern": "^/dummies\\?dummyBoolean=0"},
38
- "@type": {"pattern": "^hydra:PartialCollectionView$"}
38
+ "type": "object",
39
+ "properties": {
40
+ "@id": {"pattern": "^/dummies\\?dummyBoolean=true"},
41
+ "@type": {"pattern": "^hydra:PartialCollectionView$"}
42
+ }
39
43
}
40
44
}
41
45
}
42
46
"""
47
+ And the JSON node "hydra:totalItems" should be equal to 15
43
48
44
49
Scenario : Get collection by dummyBoolean true
45
50
When I send a "GET" request to "/dummies?dummyBoolean=1"
@@ -70,14 +75,18 @@ Feature: Boolean filter on collections
70
75
}
71
76
},
72
77
"hydra:view": {
73
- "@id": {"pattern": "^/dummies\\?dummyBoolean=1"},
74
- "@type": {"pattern": "^hydra:PartialCollectionView$"}
78
+ "type": "object",
79
+ "properties": {
80
+ "@id": {"pattern": "^/dummies\\?dummyBoolean=1"},
81
+ "@type": {"pattern": "^hydra:PartialCollectionView$"}
82
+ }
75
83
}
76
84
}
77
85
}
78
86
"""
87
+ And the JSON node "hydra:totalItems" should be equal to 15
88
+
79
89
Scenario : Get collection by dummyBoolean false
80
- Given there is "15" dummy objects with dummyBoolean false
81
90
When I send a "GET" request to "/dummies?dummyBoolean=false"
82
91
Then the response status code should be 200
83
92
And the response should be in JSON
@@ -97,22 +106,65 @@ Feature: Boolean filter on collections
97
106
"properties": {
98
107
"@id": {
99
108
"oneOf": [
100
- {"pattern": "^/dummies/1 $"},
101
- {"pattern": "^/dummies/2 $"},
102
- {"pattern": "^/dummies/3 $"}
109
+ {"pattern": "^/dummies/16 $"},
110
+ {"pattern": "^/dummies/17 $"},
111
+ {"pattern": "^/dummies/18 $"}
103
112
]
104
113
}
105
114
}
106
115
}
107
116
},
108
117
"hydra:view": {
109
- "@id": {"pattern": "^/dummies\\?dummyBoolean=false"},
110
- "@type": {"pattern": "^hydra:PartialCollectionView$"}
118
+ "type": "object",
119
+ "properties": {
120
+ "@id": {"pattern": "^/dummies\\?dummyBoolean=false"},
121
+ "@type": {"pattern": "^hydra:PartialCollectionView$"}
122
+ }
111
123
}
112
124
}
113
125
}
114
126
"""
127
+ And the JSON node "hydra:totalItems" should be equal to 10
115
128
129
+ Scenario : Get collection by dummyBoolean false
130
+ When I send a "GET" request to "/dummies?dummyBoolean=0"
131
+ Then the response status code should be 200
132
+ And the response should be in JSON
133
+ And the header "Content-Type" should be equal to "application/ld+json; charset=utf-8"
134
+ And the JSON should be valid according to this schema:
135
+ """
136
+ {
137
+ "type": "object",
138
+ "properties": {
139
+ "@context": {"pattern": "^/contexts/Dummy$"},
140
+ "@id": {"pattern": "^/dummies$"},
141
+ "@type": {"pattern": "^hydra:Collection$"},
142
+ "hydra:member": {
143
+ "type": "array",
144
+ "items": {
145
+ "type": "object",
146
+ "properties": {
147
+ "@id": {
148
+ "oneOf": [
149
+ {"pattern": "^/dummies/16$"},
150
+ {"pattern": "^/dummies/17$"},
151
+ {"pattern": "^/dummies/18$"}
152
+ ]
153
+ }
154
+ }
155
+ }
156
+ },
157
+ "hydra:view": {
158
+ "type": "object",
159
+ "properties": {
160
+ "@id": {"pattern": "^/dummies\\?dummyBoolean=0"},
161
+ "@type": {"pattern": "^hydra:PartialCollectionView$"}
162
+ }
163
+ }
164
+ }
165
+ }
166
+ """
167
+ And the JSON node "hydra:totalItems" should be equal to 10
116
168
117
169
@dropSchema
118
170
Scenario : Get collection ordered by a non valid properties
@@ -144,12 +196,16 @@ Feature: Boolean filter on collections
144
196
}
145
197
},
146
198
"hydra:view": {
147
- "@id": {"pattern": "^/dummies\\?unknown=0"},
148
- "@type": {"pattern": "^hydra:PartialCollectionView$"}
199
+ "type": "object",
200
+ "properties": {
201
+ "@id": {"pattern": "^/dummies\\?unknown=0"},
202
+ "@type": {"pattern": "^hydra:PartialCollectionView$"}
203
+ }
149
204
}
150
205
}
151
206
}
152
207
"""
208
+ And the JSON node "hydra:totalItems" should be equal to 25
153
209
154
210
When I send a "GET" request to "/dummies?unknown=1"
155
211
Then the response status code should be 200
@@ -179,9 +235,13 @@ Feature: Boolean filter on collections
179
235
}
180
236
},
181
237
"hydra:view": {
182
- "@id": {"pattern": "^/dummies\\?unknown=1$"},
183
- "@type": {"pattern": "^hydra:PartialCollectionView$"}
238
+ "type": "object",
239
+ "properties": {
240
+ "@id": {"pattern": "^/dummies\\?unknown=1"},
241
+ "@type": {"pattern": "^hydra:PartialCollectionView$"}
242
+ }
184
243
}
185
244
}
186
245
}
187
246
"""
247
+ And the JSON node "hydra:totalItems" should be equal to 25
0 commit comments