Sha256: 9a5dca23ff2ad66925d146375f372cc66ba3fba8fe58d1d2ba7b84529d721b26

Contents?: true

Size: 866 Bytes

Versions: 30

Compression:

Stored size: 866 Bytes

Contents

require 'spec_helper_integration'

describe Doorkeeper do
  describe 'authenticate' do
    let(:token) { double('Token') }
    let(:request) { double('ActionDispatch::Request') }
    before do
      allow(Doorkeeper::OAuth::Token).to receive(:authenticate).
        with(request, *token_strategies) { token }
    end

    context 'with specific access token strategies' do
      let(:token_strategies) { [:first_way, :second_way] }

      it 'authenticates the token from the request' do
        expect(Doorkeeper.authenticate(request, token_strategies)).to eq(token)
      end
    end

    context 'with default access token strategies' do
      let(:token_strategies) { Doorkeeper.configuration.access_token_methods }

      it 'authenticates the token from the request' do
        expect(Doorkeeper.authenticate(request)).to eq(token)
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 2 rubygems

Version Path
doorkeeper-2.1.1 spec/lib/doorkeeper_spec.rb
doorkeeper-2.1.0 spec/lib/doorkeeper_spec.rb
doorkeeper-2.0.1 spec/lib/doorkeeper_spec.rb
doorkeeper-1.4.1 spec/lib/doorkeeper_spec.rb
doorkeeper-2.0.0 spec/lib/doorkeeper_spec.rb
doorkeeper-2.0.0.rc3 spec/lib/doorkeeper_spec.rb
doorkeeper-2.0.0.rc2 spec/lib/doorkeeper_spec.rb
doorkeeper-2.0.0.alpha1 spec/lib/doorkeeper_spec.rb
doorkeeper-1.4.0 spec/lib/doorkeeper_spec.rb
doorkeeper-1.3.1 spec/lib/doorkeeper_spec.rb