my_john_deere_api 0.15.9 → 0.15.10

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
  SHA256:
3
- metadata.gz: b59153517250d351f304c88afbc63264b724b4e837dcd32ddbf46e78095b7f64
4
- data.tar.gz: 47c82c3330c6920d7239463791c8f774b520ef600d8eb07c1cb6b1c42f07e88a
3
+ metadata.gz: 6693823c9cdd0da77a655930d27c822ee812ac55a7282c2071d517b65a111f11
4
+ data.tar.gz: d61263b07ad0894f5c3001241b5c0559b7ab64e71b99b0a2373474a3a0a4b40a
5
5
  SHA512:
6
- metadata.gz: dea690278b241140b6efa4b8dcbbcdaeaaa8945df1c3d6bd57b12b027799943bd267505c4f56e0d4482f94ba70e71b99e218ee32445c77271b067ada8c9712aa
7
- data.tar.gz: 149abb0db17cba746f607f72168b2e445dc623614c8be7225c3bb0cff6cc1e558e4534bafc6f2d6e59f9bfc73dc4eb2177680c50f072cfb84120024cfe5f0931
6
+ metadata.gz: dd6e9db9f627140b5442fe104f2f1603b28e98f13d11ee057ef76c160c65d69a02cb215ad8944cd1cc539238f99e65eee0d7498d66e4753b034996ca6cf25363
7
+ data.tar.gz: ceb1d485b7ac8c79401c05724aade4f9841c98549f7bdea317b3666a99a8d125e4171f1c9df3fbd43aa0a623bb509a84fa30e3ed3d659a583ac359cf1a5fd101
@@ -1,3 +1,3 @@
1
1
  module MyJohnDeereApi
2
- VERSION='0.15.9'
2
+ VERSION='0.15.10'
3
3
  end
@@ -48,7 +48,7 @@ describe 'MyJohnDeereApi::Authorize' do
48
48
  url = VCR.use_cassette('get_request_token') { authorize.authorize_url }
49
49
  links = VCR.use_cassette('catalog') { JD::Consumer.new(api_key, api_secret, environment: :sandbox).send(:links) }
50
50
 
51
- assert_includes url, "#{links[:authorize_request_token]}"
51
+ assert_includes url, links[:authorize_request_token]
52
52
 
53
53
  query = URI.parse(url).query
54
54
  params = CGI::parse(query)
@@ -74,7 +74,7 @@ describe 'MyJohnDeereApi::Client' do
74
74
 
75
75
  assert_equal '201', response.code
76
76
  assert_equal 'Created', response.message
77
- assert_includes response['Location'], "/assets/#{asset_id}"
77
+ assert_equal "#{base_url}/assets/#{asset_id}", response['Location']
78
78
  end
79
79
 
80
80
  it 'prepends the leading slash if needed' do
@@ -84,7 +84,7 @@ describe 'MyJohnDeereApi::Client' do
84
84
 
85
85
  assert_equal '201', response.code
86
86
  assert_equal 'Created', response.message
87
- assert_includes response['Location'], "/assets/#{asset_id}"
87
+ assert_equal "#{base_url}/assets/#{asset_id}", response['Location']
88
88
  end
89
89
  end
90
90
 
@@ -152,7 +152,7 @@ describe 'MyJohnDeereApi::Request::Create::Asset' do
152
152
  assert_kind_of Hash, body[:links].first
153
153
  assert_equal 'Link', body[:links].first['@type']
154
154
  assert_equal 'contributionDefinition', body[:links].first['rel']
155
- assert_equal "#{ENV['BASE_URL']}/platform/contributionDefinitions/#{contribution_definition_id}",
155
+ assert_equal "#{base_url}/contributionDefinitions/#{contribution_definition_id}",
156
156
  body[:links].first['uri']
157
157
  end
158
158
  end
@@ -51,6 +51,10 @@ class Minitest::Spec
51
51
  @_accessor ||= VCR.use_cassette('catalog') { client.send(:accessor) }
52
52
  end
53
53
 
54
+ def base_url
55
+ @base_url ||= accessor.consumer.site
56
+ end
57
+
54
58
  def api_key
55
59
  CONFIG.api_key
56
60
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: my_john_deere_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.9
4
+ version: 0.15.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jaime Bellmyer