forked from api-platform/core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathiri_only.feature
More file actions
58 lines (55 loc) · 1.99 KB
/
iri_only.feature
File metadata and controls
58 lines (55 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Feature: JSON-LD using iri_only parameter
In order to improve Vulcain support
As a Vulcain user and as a developer
I should be able to only get an IRI list when I ask a resource.
Scenario Outline: Retrieve Dummy's resource context with iri_only
When I send a "GET" request to "<uri>"
Then the response status code should be 200
And the response should be in JSON
And the header "Content-Type" should be equal to "application/ld+json; charset=utf-8"
And the JSON should be equal to:
"""
{
"@context": {
"@vocab": "http://example.com/docs.jsonld#",
"hydra": "http://www.w3.org/ns/hydra/core#",
"hydra:member": {
"@type": "@id"
}
}
}
"""
Examples:
| uri |
| /contexts/IriOnlyDummy |
| /contexts/IriOnlyDummy.jsonld |
Scenario: Retrieve Dummy's resource context with invalid format returns an error
When I send a "GET" request to "/contexts/IriOnlyDummy.json"
Then the response status code should be 404
@createSchema
Scenario: Retrieve Dummies with iri_only and jsonld_embed_context
Given there are 3 iriOnlyDummies
When I send a "GET" request to "/iri_only_dummies"
Then the response status code should be 200
And the response should be in JSON
And the header "Content-Type" should be equal to "application/ld+json; charset=utf-8"
And the JSON should be equal to:
"""
{
"@context": {
"@vocab": "http://example.com/docs.jsonld#",
"hydra": "http://www.w3.org/ns/hydra/core#",
"hydra:member": {
"@type": "@id"
}
},
"@id": "/iri_only_dummies",
"@type": "hydra:Collection",
"hydra:member": [
"/iri_only_dummies/1",
"/iri_only_dummies/2",
"/iri_only_dummies/3"
],
"hydra:totalItems": 3
}
"""