Sha256: a09d6959d754ee7f265ee017e98ad6d4e3590cacca6eea7f19e16680a9047c6d

Contents?: true

Size: 656 Bytes

Versions: 7

Compression:

Stored size: 656 Bytes

Contents

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

7 entries across 7 versions & 3 rubygems

Version Path
doorkeeper-5.0.3 spec/lib/doorkeeper_spec.rb
doorkeeper-5.1.0.rc2 spec/lib/doorkeeper_spec.rb
doorkeeper-5.1.0.rc1 spec/lib/doorkeeper_spec.rb
doorkeeper-5.0.2 spec/lib/doorkeeper_spec.rb
doorkeeper-mongodb-5.0.0 spec/lib/doorkeeper_spec.rb
doorkeeper-5.0.1 spec/lib/doorkeeper_spec.rb
doorkeeper-sequel-2.0.0 spec/lib/doorkeeper_spec.rb