cucumber-api 0.6 → 0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -0
- data/features/sample.feature +8 -8
- data/lib/cucumber-api/steps.rb +4 -0
- data/lib/cucumber-api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 58a6004ffba95c36be83a6387b5cccb7ef4ffd02
|
4
|
+
data.tar.gz: 7533b5f37df30a1688ac9771c7a62d45bbf16bcb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d17fce9a70de89976349b12b9d412d736b30737f5f8f6fea6d2d70d3d5b9782c0b76925bdf529eba90e7b00dfe054a6cadd7c927b7c58526eff5da122f56d96c
|
7
|
+
data.tar.gz: 614efc58ed2d28cb8f94cb4117f77d8ae5c04c6a650d7b71cea5f39e0e086651cbdf5434f50a2a409aacfa7a76e41acbea644002d958bd3804883143f1278c6b
|
data/README.md
CHANGED
@@ -176,6 +176,12 @@ Response caching is provided for GET requests by default. This is useful when yo
|
|
176
176
|
|
177
177
|
Only the first request to that endpoint is made, subsequent requests will use cached response. Response caching is only available for GET method.
|
178
178
|
|
179
|
+
The response cache can also be cleared if needed:
|
180
|
+
|
181
|
+
```gherkin
|
182
|
+
Given I clear the response cache
|
183
|
+
```
|
184
|
+
|
179
185
|
## Dependencies
|
180
186
|
* [cucumber](https://github.com/cucumber/cucumber) for BDD style specs
|
181
187
|
* [jsonpath](https://github.com/joshbuddy/jsonpath) for traversal of JSON response via [JSON path](http://goessner.net/articles/JsonPath/)
|
data/features/sample.feature
CHANGED
@@ -1,17 +1,18 @@
|
|
1
1
|
# https://github.com/HackerNews/API
|
2
2
|
Feature: Hacker News REST API validation
|
3
3
|
|
4
|
-
|
4
|
+
Background:
|
5
5
|
Given I send and accept JSON
|
6
|
-
|
6
|
+
|
7
|
+
Scenario: Verify top stories JSON schema
|
8
|
+
When I add Headers:
|
7
9
|
| Cache-Control | no-cache |
|
8
|
-
|
10
|
+
And I send a GET request to "https://hacker-news.firebaseio.com/v0/topstories.json?print=pretty"
|
9
11
|
Then the response status should be "200"
|
10
12
|
And the JSON response should follow "features/schemas/topstories.json"
|
11
13
|
|
12
14
|
Scenario Outline: Verify item JSON schema
|
13
|
-
When I send
|
14
|
-
And I send a GET request to "https://hacker-news.firebaseio.com/v0/topstories.json?print=pretty"
|
15
|
+
When I send a GET request to "https://hacker-news.firebaseio.com/v0/topstories.json?print=pretty"
|
15
16
|
Then the response status should be "200"
|
16
17
|
And the JSON response root should be array
|
17
18
|
When I grab "$[0]" as "id"
|
@@ -30,8 +31,7 @@ Feature: Hacker News REST API validation
|
|
30
31
|
| url | string | optional |
|
31
32
|
|
32
33
|
Scenario: Demonstrate setting the JSON body with a docstring
|
33
|
-
|
34
|
-
And I set JSON request body to:
|
34
|
+
When I set JSON request body to:
|
35
35
|
"""
|
36
36
|
{
|
37
37
|
"title": "foo",
|
@@ -39,7 +39,7 @@ Feature: Hacker News REST API validation
|
|
39
39
|
"userId": 1
|
40
40
|
}
|
41
41
|
"""
|
42
|
-
|
42
|
+
And I send a POST request to "http://jsonplaceholder.typicode.com/posts"
|
43
43
|
Then the response status should be "201"
|
44
44
|
And the JSON response should have "id" of type numeric and value "101"
|
45
45
|
And the JSON response should have "title" of type string and value "foo"
|
data/lib/cucumber-api/steps.rb
CHANGED
data/lib/cucumber-api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cucumber-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.7'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ha Duy Trung
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|