cucumber-json-api-steps 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8421255084e5594fa48c7d9973ebe5a4b7cdb2d2
4
- data.tar.gz: ae8296b7a38b78bd55768361e7cb8e7a7c952a96
3
+ metadata.gz: ced5fd493fab03c4c44a23053ad29186428c8ff8
4
+ data.tar.gz: 3ed021009f9b3a54a390a91752dd1a63567bdeba
5
5
  SHA512:
6
- metadata.gz: e16ecb840f8949702c51187b4f7af4b1adbf243a8fc1811d02a49f2d0364595297649117e09df29a9083efc6bcb2ecd190652daf66ff43aacff59b3b37dc7712
7
- data.tar.gz: 7ce90528ce946587e768220015903e9a80c00af32666eea84095d82cf7e611507ba74d99a81a4c75c54808dbd0e0c38dd57d9f0034cfba03a437560b84233e21
6
+ metadata.gz: 784eb0db982cde9d5d9dcaaa5b55cde6f1a10d0fd722f7c27a820dff5faaa3119c6b249c0a985d6fcf4e188fcfab1c8966d5906af6841b8967066ddf5c57aaab
7
+ data.tar.gz: d36ebd615b1d5fdbf73f4e45c4f36f028f9cec17acb02b2735ae26c118e561757166a0c64cea54e95e4af989b47fe310087a22d876aa2a3d010928f808f3caa7
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Cucumber::Json::Api::Steps
2
2
 
3
- TODO: Write a gem description
3
+ Test JSON API responses from Cucumber.
4
4
 
5
5
  ## Installation
6
6
 
@@ -2,7 +2,7 @@ module Cucumber
2
2
  module Json
3
3
  module Api
4
4
  module Steps
5
- VERSION = "0.0.1"
5
+ VERSION = "0.0.2"
6
6
  end
7
7
  end
8
8
  end
@@ -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!(':track_id', @track.id.to_s) if @track
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!(':track_id', @track.id.to_s) if @track
33
- body.gsub!(':track_id', @track.id.to_s) if @track
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!('https://playlists.bleacherreport.com', 'http://example.org')
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber-json-api-steps
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Pruitt