@@ -226,3 +226,71 @@ Feature: Order filter on collections
226
226
}
227
227
}
228
228
"""
229
+
230
+ @createSchema
231
+ @dropSchema
232
+ Scenario : Search for entities within a range
233
+ Given there is "2" dummy objects with dummyDate
234
+ When I send a "GET" request to "/dummies?dummyDate[after]="
235
+ Then the response status code should be 200
236
+ And the response should be in JSON
237
+ And the header "Content-Type" should be equal to "application/ld+json"
238
+ And the JSON node "hydra:totalItems" should be equal to "2"
239
+ And the JSON should be valid according to this schema:
240
+ """
241
+ {
242
+ "type": "object",
243
+ "properties": {
244
+ "@context": {"pattern": "^/contexts/Dummy$"},
245
+ "@id": {"pattern": "^/dummies\\?dummyDate\\[after\\]=$"},
246
+ "@type": {"pattern": "^hydra:PagedCollection$"},
247
+ "hydra:totalItems": {"type":"number"},
248
+ "hydra:member": {
249
+ "type": "array",
250
+ "items": {
251
+ "type": "object",
252
+ "properties": {
253
+ "@id": {
254
+ "oneOf": [
255
+ {"pattern": "^/dummies/1$"},
256
+ {"pattern": "^/dummies/2$"}
257
+ ]
258
+ }
259
+ }
260
+ }
261
+ }
262
+ }
263
+ }
264
+ """
265
+
266
+ When I send a "GET" request to "/dummies?dummyDate[before]="
267
+ Then the response status code should be 200
268
+ And the response should be in JSON
269
+ And the header "Content-Type" should be equal to "application/ld+json"
270
+ And the JSON node "hydra:totalItems" should be equal to "2"
271
+ And the JSON should be valid according to this schema:
272
+ """
273
+ {
274
+ "type": "object",
275
+ "properties": {
276
+ "@context": {"pattern": "^/contexts/Dummy$"},
277
+ "@id": {"pattern": "^/dummies\\?dummyDate\\[before\\]=$"},
278
+ "@type": {"pattern": "^hydra:PagedCollection$"},
279
+ "hydra:totalItems": {"type":"number"},
280
+ "hydra:member": {
281
+ "type": "array",
282
+ "items": {
283
+ "type": "object",
284
+ "properties": {
285
+ "@id": {
286
+ "oneOf": [
287
+ {"pattern": "^/dummies/1$"},
288
+ {"pattern": "^/dummies/2$"}
289
+ ]
290
+ }
291
+ }
292
+ }
293
+ }
294
+ }
295
+ }
296
+ """
0 commit comments