Sha256: 84374fb09c335f7f8976bbfee2ad19d326ffebf9cf998d4a37d51545c1ab1d73

Contents?: true

Size: 756 Bytes

Versions: 61

Compression:

Stored size: 756 Bytes

Contents

require 'spec_helper_integration'

module Doorkeeper::OAuth
  describe ClientCredentialsRequest do
    let(:server) { Doorkeeper.configuration }

    context 'with a valid request' do
      let(:client) { FactoryGirl.create :application }

      it 'issues an access token' do
        request = ClientCredentialsRequest.new(server, client, {})
        expect do
          request.authorize
        end.to change { Doorkeeper::AccessToken.count }.by(1)
      end
    end

    describe 'with an invalid request' do
      it 'does not issue an access token' do
        request = ClientCredentialsRequest.new(server, nil, {})
        expect do
          request.authorize
        end.to_not change { Doorkeeper::AccessToken.count }
      end
    end
  end
end

Version data entries

61 entries across 61 versions & 2 rubygems

Version Path
doorkeeper-1.0.0.rc2 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-1.0.0.rc1 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-0.7.4 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-0.7.3 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-0.7.2 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-0.7.1 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-0.7.0 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-0.6.7 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-0.6.6 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-0.6.5 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-0.6.4 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-0.6.3 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-0.6.2 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-0.6.1 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-0.6.0 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-0.6.0.rc1 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-0.5.0 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-0.5.0.rc1 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-0.4.2 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-0.4.1 spec/lib/oauth/client_credentials_integration_spec.rb