Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add spec to ensure correct expiry on OAuth2::AccessToken

  • Loading branch information...
commit 20b668119b39e417b55735d30e2dfee43cf7d88a 1 parent 3b4b33b
@watsonbox watsonbox authored
Showing with 7 additions and 1 deletion.
  1. +7 −1 spec/omniauth/strategies/facebook_spec.rb
View
8 spec/omniauth/strategies/facebook_spec.rb
@@ -425,7 +425,8 @@
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 @@
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
Please sign in to comment.
Something went wrong with that request. Please try again.