This repository was archived by the owner on Sep 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 65
Expand file tree
/
Copy pathapi.feature
More file actions
58 lines (54 loc) · 1.86 KB
/
api.feature
File metadata and controls
58 lines (54 loc) · 1.86 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: I am able to describe API
Scenario: I send a get request
Given I prepare a GET request on "/api"
When I send the request
Then the response should contains the following headers:
| Content-type | text/html |
And I should receive a 200 response
And the response should contains:
"""
<body>
<h1>This is a test</h1>
</body>
"""
And the response should contains "This is a test"
Scenario: I send a put request
Given I prepare a PUT request on "/api"
When I send the request
Then I should receive a 404 response
Scenario: I send a get request and recieved a json
Given I prepare a GET request on "/api"
Given I specified the following request headers:
| format | json |
When I send the request
Then the response should contains the following headers:
| Content-type | application/json |
And I should receive a 200 response
Then the response should contains the following json:
"""
{
"plop": {
"plip": 13,
"foo": "bar"
}
}
"""
Scenario: I send a post request and recieved a json
Given I prepare a POST request on "/api"
Given I specified the following request headers:
| format | json |
And I specified the following request data:
| id | 17 |
When I send the request
Then the response should contains the following headers:
| Content-type | application/json |
And I should receive a 202 response
Then the response should contains the following json:
"""
{
"plop": {
"plip": 17,
"foo": "bar"
}
}
"""