1
0
Fork 0
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:
Howard Wilson 2012-04-30 00:05:16 +02:00
parent 3b4b33bfc4
commit 20b668119b

View file

@ -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