Sha256: 92eec413437678717a677038923a14084884aaf52e30f8d06b17b9f9bcb9c145

Contents?: true

Size: 775 Bytes

Versions: 15

Compression:

Stored size: 775 Bytes

Contents

# frozen_string_literal: true

require "spec_helper"

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

    context "with a valid request" do
      let(:client) { FactoryBot.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

15 entries across 15 versions & 2 rubygems

Version Path
doorkeeper-5.1.2 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-5.2.6 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-5.1.1 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-5.2.5 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-sequel-2.2.0 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-5.2.4 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-5.2.3 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-5.2.2 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-sequel-2.1.0 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-5.2.1 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-5.2.0 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-5.2.0.rc3 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-5.2.0.rc2 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-5.2.0.rc1 spec/lib/oauth/client_credentials_integration_spec.rb
doorkeeper-5.1.0 spec/lib/oauth/client_credentials_integration_spec.rb