cucumber-json-api-steps 0.0.2 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/cucumber-json-api-steps.gemspec +1 -0
- data/lib/cucumber/json/api/steps.rb +3 -3
- data/lib/cucumber/json/api/steps/version.rb +1 -1
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 380530866f0da70d5b1e83f2922751ae7da0911f
|
4
|
+
data.tar.gz: 05c3730c98196ac4b7473c474b2c68260b300ada
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c50fb13c064db0a1e7f0ead0054474e5ce382a15c3c1eea54892b6688c34197c1882385059a681c3d440a6b9419209e8630c5af6cc47f7ac346efd034985cfe
|
7
|
+
data.tar.gz: ec583fac82d06fba6ffb12483e8faec32f793666e4f75689bdabe315ff464650424f7eb8417874aa7d3258ff7d335e60937c6fd94e295f551f2b3beb32f689de
|
@@ -11,7 +11,7 @@ class HTTPClient
|
|
11
11
|
body = body.respond_to?(:keys) ? nil : body
|
12
12
|
|
13
13
|
env = { method: verb, format: :json }
|
14
|
-
env[:input] = body if body
|
14
|
+
env[:input] = StringIO.new(body.to_json) if body
|
15
15
|
env[:params] = params if params
|
16
16
|
|
17
17
|
request(path, env)
|
@@ -23,12 +23,12 @@ class HTTPClient
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
When(/^I make a (GET|POST|PUT|PATCH|DELETE) request to (
|
26
|
+
When(/^I make a (GET|POST|PUT|PATCH|DELETE) request to (\/.*\.json)$/) do |verb, path|
|
27
27
|
path.gsub!(/:(\w)_id/) {|m| instance_variable_get("@#{$1}").id}
|
28
28
|
@response = HTTPClient.new.make_request(verb, path)
|
29
29
|
end
|
30
30
|
|
31
|
-
When(/^I make a (GET|POST|PUT|PATCH|DELETE) request to (
|
31
|
+
When(/^I make a (GET|POST|PUT|PATCH|DELETE) request to (\/.*\.json) with the body:$/) do |verb, path, body|
|
32
32
|
path.gsub!(/:(\w+)_id/) {|m| instance_variable_get("@#{$1}").id}
|
33
33
|
body.gsub!(/:(\w+)_id/) {|m| instance_variable_get("@#{$1}").id}
|
34
34
|
@response = HTTPClient.new.make_request(verb, path, JSON.parse(body))
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cucumber-json-api-steps
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Pruitt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-06-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jsonpath
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: cucumber-rails
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: bundler
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -101,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
101
115
|
version: '0'
|
102
116
|
requirements: []
|
103
117
|
rubyforge_project:
|
104
|
-
rubygems_version: 2.2.
|
118
|
+
rubygems_version: 2.2.2
|
105
119
|
signing_key:
|
106
120
|
specification_version: 4
|
107
121
|
summary: Cucumber steps for testing JSON API's
|