Sha256: 62cb8b1780e869a6f4bd07a4913815c25e635e1ed873d1f472d077f05688cf7e

Contents?: true

Size: 756 Bytes

Versions: 60

Compression:

Stored size: 756 Bytes

Contents

require 'spec_helper.rb'

describe Rack::OAuth2::Server::Token::ClientCredentials do
  let(:request) { Rack::MockRequest.new app }
  let(:app) do
    Rack::OAuth2::Server::Token.new do |request, response|
      response.access_token = Rack::OAuth2::AccessToken::Bearer.new(:access_token => 'access_token')
    end
  end
  let(:params) do
    {
      :grant_type => 'client_credentials',
      :client_id => 'client_id',
      :client_secret => 'client_secret'
    }
  end
  subject { request.post('/', :params => params) }

  its(:status)       { should == 200 }
  its(:content_type) { should == 'application/json' }
  its(:body)         { should include '"access_token":"access_token"' }
  its(:body)         { should include '"token_type":"bearer"' }
end

Version data entries

60 entries across 60 versions & 2 rubygems

Version Path
rack-oauth2-1.1.1 spec/rack/oauth2/server/token/client_credentials_spec.rb
rack-oauth2-1.1.0 spec/rack/oauth2/server/token/client_credentials_spec.rb
rack-oauth2-1.0.10 spec/rack/oauth2/server/token/client_credentials_spec.rb
rack-oauth2-1.0.9 spec/rack/oauth2/server/token/client_credentials_spec.rb
rack-oauth2-1.0.8 spec/rack/oauth2/server/token/client_credentials_spec.rb
rack-oauth2-revibe-1.0.7 spec/rack/oauth2/server/token/client_credentials_spec.rb
rack-oauth2-1.0.7 spec/rack/oauth2/server/token/client_credentials_spec.rb
rack-oauth2-1.0.6 spec/rack/oauth2/server/token/client_credentials_spec.rb
rack-oauth2-1.0.5 spec/rack/oauth2/server/token/client_credentials_spec.rb
rack-oauth2-1.0.4 spec/rack/oauth2/server/token/client_credentials_spec.rb
rack-oauth2-1.0.3 spec/rack/oauth2/server/token/client_credentials_spec.rb
rack-oauth2-1.0.2 spec/rack/oauth2/server/token/client_credentials_spec.rb
rack-oauth2-1.0.1 spec/rack/oauth2/server/token/client_credentials_spec.rb
rack-oauth2-1.0.0 spec/rack/oauth2/server/token/client_credentials_spec.rb
rack-oauth2-0.14.9 spec/rack/oauth2/server/token/client_credentials_spec.rb
rack-oauth2-0.14.8 spec/rack/oauth2/server/token/client_credentials_spec.rb
rack-oauth2-0.14.7 spec/rack/oauth2/server/token/client_credentials_spec.rb
rack-oauth2-0.14.6 spec/rack/oauth2/server/token/client_credentials_spec.rb
rack-oauth2-0.14.5 spec/rack/oauth2/server/token/client_credentials_spec.rb
rack-oauth2-0.14.4 spec/rack/oauth2/server/token/client_credentials_spec.rb