oauth2 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/oauth2/access_token.rb +1 -0
- data/lib/oauth2/version.rb +1 -1
- data/spec/oauth2/access_token_spec.rb +7 -0
- metadata +2 -2
data/lib/oauth2/access_token.rb
CHANGED
@@ -44,6 +44,7 @@ module OAuth2
|
|
44
44
|
end
|
45
45
|
@expires_in ||= opts.delete('expires')
|
46
46
|
@expires_in &&= @expires_in.to_i
|
47
|
+
@expires_at &&= @expires_at.to_i
|
47
48
|
@expires_at ||= Time.now.to_i + @expires_in if @expires_in
|
48
49
|
@options = {:mode => opts.delete(:mode) || :header,
|
49
50
|
:header_format => opts.delete(:header_format) || 'Bearer %s',
|
data/lib/oauth2/version.rb
CHANGED
@@ -59,6 +59,13 @@ describe AccessToken do
|
|
59
59
|
target.options[:header_format].should == 'Bearer %'
|
60
60
|
target.options[:mode].should == :body
|
61
61
|
end
|
62
|
+
|
63
|
+
it "initializes with a string expires_at" do
|
64
|
+
hash = {:access_token => token, :expires_at => '1361396829', 'foo' => 'bar'}
|
65
|
+
target = AccessToken.from_hash(client, hash)
|
66
|
+
assert_initialized_token(target)
|
67
|
+
expect(target.expires_at).to be_a(Integer)
|
68
|
+
end
|
62
69
|
end
|
63
70
|
|
64
71
|
describe '#request' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oauth2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2013-02-20 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: faraday
|