Sha256: 6e1b0405b7b0aa861c2d0649a3176d3e3b5dac83cd677a2ce51bf37897a91555

Contents?: true

Size: 701 Bytes

Versions: 5

Compression:

Stored size: 701 Bytes

Contents

# frozen_string_literal: true

require "spec_helper"

RSpec.describe Doorkeeper do
  describe "#authenticate" do
    let(:request) { double }

    it "calls OAuth::Token#authenticate" do
      token_strategies = described_class.config.access_token_methods

      expect(Doorkeeper::OAuth::Token).to receive(:authenticate)
        .with(request, *token_strategies)

      described_class.authenticate(request)
    end

    it "accepts custom token strategies" do
      token_strategies = %i[first_way second_way]

      expect(Doorkeeper::OAuth::Token).to receive(:authenticate)
        .with(request, *token_strategies)

      described_class.authenticate(request, token_strategies)
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
doorkeeper-mongodb-5.3.0 spec/lib/doorkeeper_spec.rb
doorkeeper-mongodb-5.2.3 spec/lib/doorkeeper_spec.rb
doorkeeper-sequel-2.4.0 spec/lib/doorkeeper_spec.rb
doorkeeper-mongodb-5.2.2 spec/lib/doorkeeper_spec.rb
doorkeeper-sequel-2.3.0 spec/lib/doorkeeper_spec.rb