redbooth-ruby 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/redbooth-ruby/session.rb +4 -1
- data/lib/redbooth-ruby/version.rb +1 -1
- data/spec/cassettes/RedboothRuby_Session/_refresh_access_token_/{refreshes_the_access_token.yml → refreshes_the_access_token/.yml} +1 -1
- data/spec/cassettes/RedboothRuby_Session/_refresh_access_token_/{.yml → updates_intance_variables/.yml} +0 -0
- data/spec/redbooth-ruby/session_spec.rb +10 -5
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 01798b910c79943d677dfcb2c6ae9e58069fd822
|
4
|
+
data.tar.gz: df3746d0ce68062dae23b2ccebd4f1694227fa3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e22496072c0dfb59a984540cc1625140c0e9094af7bfc9ff869727210198bc1fb127997d8196d23f2aac8578a8e3553d0e4be09b57587bbcf199f8245b8944fd
|
7
|
+
data.tar.gz: dd57c0e165ec011a03a49d9d876e1ffbf680da091c5f0b6a8e3754a5696e7113d7ed326d6ad9d03cd01f6c04a42b47c025292ea0bb2c936d6c2f98fc3788fa3c
|
@@ -53,7 +53,10 @@ module RedboothRuby
|
|
53
53
|
new_access_token = access_token.refresh!
|
54
54
|
if new_access_token
|
55
55
|
on_token_refresh.call(access_token, new_access_token) if on_token_refresh.is_a?(Proc)
|
56
|
-
@
|
56
|
+
@token = new_access_token.token
|
57
|
+
@refresh_token = new_access_token.refresh_token
|
58
|
+
@expires_in = new_access_token.expires_in
|
59
|
+
@access_token = nil
|
57
60
|
end
|
58
61
|
new_access_token
|
59
62
|
end
|
@@ -52,4 +52,4 @@ http_interactions:
|
|
52
52
|
string: '{"access_token":"_your_new_user_token_","token_type":"bearer","expires_in":7200,"refresh_token":"_your_new_user_refresh_token_","scope":"all"}'
|
53
53
|
http_version:
|
54
54
|
recorded_at: Tue, 17 Feb 2015 19:04:22 GMT
|
55
|
-
recorded_with: VCR 2.9.3
|
55
|
+
recorded_with: VCR 2.9.3
|
File without changes
|
@@ -74,12 +74,17 @@ describe RedboothRuby::Session, vcr: 'session' do
|
|
74
74
|
end
|
75
75
|
|
76
76
|
describe '#refresh_access_token!' do
|
77
|
-
|
77
|
+
context 'updates intance variables' do
|
78
|
+
before { session.refresh_access_token! }
|
79
|
+
it { expect(session.token).to eql('_your_new_user_token_') }
|
80
|
+
it { expect(session.refresh_token).to eql('_your_new_user_refresh_token_') }
|
81
|
+
it { expect(session.expires_in).to eql(7200) }
|
82
|
+
end
|
78
83
|
|
79
|
-
|
80
|
-
session.refresh_access_token!
|
81
|
-
expect(access_token.token).to eql('_your_new_user_token_')
|
82
|
-
expect(access_token.refresh_token).to eql('_your_new_user_refresh_token_')
|
84
|
+
context 'refreshes the access_token' do
|
85
|
+
before { session.refresh_access_token! }
|
86
|
+
it { expect(session.access_token.token).to eql('_your_new_user_token_') }
|
87
|
+
it { expect(session.access_token.refresh_token).to eql('_your_new_user_refresh_token_') }
|
83
88
|
end
|
84
89
|
|
85
90
|
it 'call `on_token_refresh` with the old and new token' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redbooth-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andres Bravo
|
@@ -278,9 +278,9 @@ files:
|
|
278
278
|
- spec/cassettes/RedboothRuby_Request_Collection/_prev_page/where_is_the_first_page/.yml
|
279
279
|
- spec/cassettes/RedboothRuby_Request_Collection/_total_pages/.yml
|
280
280
|
- spec/cassettes/RedboothRuby_Request_Collection/_total_pages/where_endpoint_is_not_paginated/.yml
|
281
|
-
- spec/cassettes/RedboothRuby_Session/_refresh_access_token_/.yml
|
282
281
|
- spec/cassettes/RedboothRuby_Session/_refresh_access_token_/call_on_token_refresh_with_the_old_and_new_token.yml
|
283
|
-
- spec/cassettes/RedboothRuby_Session/_refresh_access_token_/refreshes_the_access_token
|
282
|
+
- spec/cassettes/RedboothRuby_Session/_refresh_access_token_/refreshes_the_access_token/.yml
|
283
|
+
- spec/cassettes/RedboothRuby_Session/_refresh_access_token_/updates_intance_variables/.yml
|
284
284
|
- spec/cassettes/RedboothRuby_Subtask/_create/.yml
|
285
285
|
- spec/cassettes/RedboothRuby_Subtask/_create/makes_a_new_POST_request_using_the_correct_API_endpoint_to_create_a_specific_subtask.yml
|
286
286
|
- spec/cassettes/RedboothRuby_Subtask/_delete/makes_a_new_DELETE_request_using_the_correct_API_endpoint_to_delete_a_specific_subtask.yml
|
@@ -500,9 +500,9 @@ test_files:
|
|
500
500
|
- spec/cassettes/RedboothRuby_Request_Collection/_prev_page/where_is_the_first_page/.yml
|
501
501
|
- spec/cassettes/RedboothRuby_Request_Collection/_total_pages/.yml
|
502
502
|
- spec/cassettes/RedboothRuby_Request_Collection/_total_pages/where_endpoint_is_not_paginated/.yml
|
503
|
-
- spec/cassettes/RedboothRuby_Session/_refresh_access_token_/.yml
|
504
503
|
- spec/cassettes/RedboothRuby_Session/_refresh_access_token_/call_on_token_refresh_with_the_old_and_new_token.yml
|
505
|
-
- spec/cassettes/RedboothRuby_Session/_refresh_access_token_/refreshes_the_access_token
|
504
|
+
- spec/cassettes/RedboothRuby_Session/_refresh_access_token_/refreshes_the_access_token/.yml
|
505
|
+
- spec/cassettes/RedboothRuby_Session/_refresh_access_token_/updates_intance_variables/.yml
|
506
506
|
- spec/cassettes/RedboothRuby_Subtask/_create/.yml
|
507
507
|
- spec/cassettes/RedboothRuby_Subtask/_create/makes_a_new_POST_request_using_the_correct_API_endpoint_to_create_a_specific_subtask.yml
|
508
508
|
- spec/cassettes/RedboothRuby_Subtask/_delete/makes_a_new_DELETE_request_using_the_correct_API_endpoint_to_delete_a_specific_subtask.yml
|