Sha256: caea9223e7352535aa69388c7507f1a5b9f493b488befe9f6894af2eb1835f73

Contents?: true

Size: 951 Bytes

Versions: 1

Compression:

Stored size: 951 Bytes

Contents

require 'spec_helper'

describe OmniAuth::Strategies::OAuth2 do
  def app
    ->(_env) { [200, {}, ['Hello.']] }
  end

  let(:strategy) do
    OmniAuth::Strategies::Dotloop.new(nil, @options || {}).tap do |strategy|
      allow(strategy).to receive(:request) { @request }
    end
  end

  before do
    @request = double('Request')
    allow(@request).to receive(:params) { {} }
    OmniAuth.config.test_mode = true
  end

  after do
    OmniAuth.config.test_mode = false
  end

  context 'client options' do
    subject { strategy.options.client_options }

    it 'has correct api site' do
      expect(subject.site).to eq('https://api-gateway.dotloop.com/public/v2/')
    end

    it 'has correct access token path' do
      expect(subject.token_url).to eq('https://auth.dotloop.com/oauth/token')
    end

    it 'has correct authorize url' do
      expect(subject.authorize_url).to eq('https://auth.dotloop.com/oauth/authorize')
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
omniauth-dotloop-1.0.0 spec/omniauth/strategies/dotloop_spec.rb