mirror of
https://github.com/simi/omniauth-facebook.git
synced 2022-11-09 12:32:45 -05:00
Add spec to ensure correct expiry on OAuth2::AccessToken
This commit is contained in:
parent
3b4b33bfc4
commit
20b668119b
1 changed files with 7 additions and 1 deletions
|
@ -425,7 +425,8 @@ describe OmniAuth::Strategies::Facebook do
|
|||
before do
|
||||
@payload = {
|
||||
'algorithm' => 'HMAC-SHA256',
|
||||
'oauth_token' => 'm4c0d3z'
|
||||
'oauth_token' => 'm4c0d3z',
|
||||
'expires' => Time.now.to_i
|
||||
}
|
||||
@raw_signed_request = signed_request(@payload, @client_secret)
|
||||
@request.stub(:params) do
|
||||
|
@ -440,6 +441,11 @@ describe OmniAuth::Strategies::Facebook do
|
|||
result.should be_an_instance_of(::OAuth2::AccessToken)
|
||||
result.token.should eq(@payload['oauth_token'])
|
||||
end
|
||||
|
||||
it 'returns an access token with the correct expiry time' do
|
||||
result = subject.build_access_token
|
||||
result.expires_at.should eq(@payload['expires'])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue