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-2.2.1 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-2.2.0 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-2.1.4 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-1.4.2 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-2.1.3 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-2.1.2 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-2.1.1 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-2.1.0 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-2.0.1 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-1.4.1 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-2.0.0 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-2.0.0.rc3 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-2.0.0.rc2 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-2.0.0.alpha1 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-1.4.0 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-1.3.1 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-1.3.0 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-1.2.0 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-1.1.0 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-1.0.0 spec/lib/oauth/client_credentials_integration_spec.rb