my_john_deere_api 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8956e299401f734af29fd95e23dd07305030940f4c37330ffe6b526783d3ecb
|
4
|
+
data.tar.gz: 3dfe23a403c6710384785805739d173a7f6099111e32bc7973a98d9114931e8d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29f2d83a263206d8b4fb5f076ce0cc63d7306edf05a4294e6fb195b15b55af1575e52a6c80c5610094144f2b8aca45119e31e81182e09d5823ef25b42069f0c7
|
7
|
+
data.tar.gz: e17007f771e70709d3e07c6c56017475def8b52a373dda9ef452864347a19cf1e94c0087eb4dc0d4870218639c02ad68f0f06975c35b192f7c463e0c5209a87c
|
@@ -30,6 +30,13 @@ describe 'MyJohnDeereApi::Authorize' do
|
|
30
30
|
assert_equal environment, authorize.environment
|
31
31
|
end
|
32
32
|
|
33
|
+
it 'converts environment to symbol' do
|
34
|
+
environment = 'sandbox'
|
35
|
+
|
36
|
+
authorize = VCR.use_cassette('catalog') { JD::Authorize.new(API_KEY, API_SECRET, environment: environment) }
|
37
|
+
assert_equal environment.to_sym, authorize.environment
|
38
|
+
end
|
39
|
+
|
33
40
|
it 'defaults the environment to production' do
|
34
41
|
environment = :production
|
35
42
|
|
@@ -55,7 +62,7 @@ describe 'MyJohnDeereApi::Authorize' do
|
|
55
62
|
url = VCR.use_cassette('get_request_token') { authorize.authorize_url }
|
56
63
|
links = VCR.use_cassette('catalog') { JD::Consumer.new(API_KEY, API_SECRET, environment: :sandbox).send(:links) }
|
57
64
|
|
58
|
-
assert_includes url, "#{links[:authorize_request_token]}
|
65
|
+
assert_includes url, "#{links[:authorize_request_token]}"
|
59
66
|
|
60
67
|
query = URI.parse(url).query
|
61
68
|
params = CGI::parse(query)
|
@@ -33,6 +33,14 @@ describe 'JD::Consumer' do
|
|
33
33
|
assert_equal JD::Consumer::URLS[default_environment], consumer.base_url
|
34
34
|
end
|
35
35
|
|
36
|
+
it 'converts environment string to symbol' do
|
37
|
+
environment = 'sandbox'
|
38
|
+
consumer = JD::Consumer.new(API_KEY, API_SECRET, environment: environment)
|
39
|
+
|
40
|
+
assert_equal environment.to_sym, consumer.environment
|
41
|
+
assert_equal JD::Consumer::URLS[environment.to_sym], consumer.base_url
|
42
|
+
end
|
43
|
+
|
36
44
|
it 'accepts an arbitrary base_url' do
|
37
45
|
base_url = 'https://example.com'
|
38
46
|
consumer = JD::Consumer.new(API_KEY, API_SECRET, base_url: base_url)
|