cucumber-json-api-steps 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/cucumber/json/api/steps/version.rb +1 -1
- data/lib/cucumber/json/api/steps.rb +4 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ced5fd493fab03c4c44a23053ad29186428c8ff8
|
4
|
+
data.tar.gz: 3ed021009f9b3a54a390a91752dd1a63567bdeba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 784eb0db982cde9d5d9dcaaa5b55cde6f1a10d0fd722f7c27a820dff5faaa3119c6b249c0a985d6fcf4e188fcfab1c8966d5906af6841b8967066ddf5c57aaab
|
7
|
+
data.tar.gz: d36ebd615b1d5fdbf73f4e45c4f36f028f9cec17acb02b2735ae26c118e561757166a0c64cea54e95e4af989b47fe310087a22d876aa2a3d010928f808f3caa7
|
data/README.md
CHANGED
@@ -24,13 +24,13 @@ class HTTPClient
|
|
24
24
|
end
|
25
25
|
|
26
26
|
When(/^I make a (GET|POST|PUT|PATCH|DELETE) request to (\/.*\/.*\.json)\z/) do |verb, path|
|
27
|
-
path.gsub!(
|
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
31
|
When(/^I make a (GET|POST|PUT|PATCH|DELETE) request to (\/.*\/.*\.json) with the body:\z/) do |verb, path, body|
|
32
|
-
path.gsub!(
|
33
|
-
body.gsub!(
|
32
|
+
path.gsub!(/:(\w+)_id/) {|m| instance_variable_get("@#{$1}").id}
|
33
|
+
body.gsub!(/:(\w+)_id/) {|m| instance_variable_get("@#{$1}").id}
|
34
34
|
@response = HTTPClient.new.make_request(verb, path, JSON.parse(body))
|
35
35
|
end
|
36
36
|
|
@@ -40,7 +40,7 @@ end
|
|
40
40
|
|
41
41
|
Then(/^the JSON should contain:$/) do |json|
|
42
42
|
old_json = json
|
43
|
-
json.gsub!(
|
43
|
+
json.gsub!(/https:\/\/\w+.bleacherreport.com/, 'http://example.org')
|
44
44
|
|
45
45
|
expected_paths = JsonPaths.new(json)
|
46
46
|
unexpected_paths = JsonPaths.new(@response.body).paths - expected_paths.paths
|