Sha256: f2879a7e3b6bbb582c63d77de5e28ddf5a2533e937cd6ae48ac07a09be268008

Contents?: true

Size: 687 Bytes

Versions: 15

Compression:

Stored size: 687 Bytes

Contents

# frozen_string_literal: true

require "spec_helper"

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

    it "calls OAuth::Token#authenticate" do
      token_strategies = Doorkeeper.configuration.access_token_methods

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

      Doorkeeper.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)

      Doorkeeper.authenticate(request, token_strategies)
    end
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

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