-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathsubscription-type.feature
More file actions
35 lines (31 loc) · 1.68 KB
/
subscription-type.feature
File metadata and controls
35 lines (31 loc) · 1.68 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
@notifications
Feature: Notification subscription type field
Background:
* def testContainer = rootTestContainer.createContainer()
* def setup = callonce read('../subscription-endpoint.feature')
* def subscriptionEndpoint = setup.subscriptionEndpoint
Scenario: Subscription request must contain subscription type
Given url subscriptionEndpoint
And headers clients.alice.getAuthHeaders('POST', subscriptionEndpoint)
And header Content-Type = 'application/ld+json'
And header Accept = 'application/ld+json'
And request {@context: ['https://www.w3.org/ns/solid/notification/v1'], type: '#(setup.subscriptionType)', topic: '#(testContainer.url)'}
When method POST
Then status 200
And match response.type == setup.subscriptionType
# server should respond with an error if the type is missing
Given url subscriptionEndpoint
And headers clients.alice.getAuthHeaders('POST', subscriptionEndpoint)
And header Content-Type = 'application/ld+json'
And header Accept = 'application/ld+json'
And request {@context: ['https://www.w3.org/ns/solid/notification/v1'], topic: '#(testContainer.url)'}
When method POST
Then assert responseStatus >= 400 && responseStatus < 500
# server should respond with an error if the type is unknown
Given url subscriptionEndpoint
And headers clients.alice.getAuthHeaders('POST', subscriptionEndpoint)
And header Content-Type = 'application/ld+json'
And header Accept = 'application/ld+json'
And request {@context: ['https://www.w3.org/ns/solid/notification/v1'], type: 'UNKNOWN', topic: '#(testContainer.url)'}
When method POST
Then assert responseStatus >= 400 && responseStatus < 500