Sha256: c6ab1b57e83751ca8f7a1ca9a3a8e3dbc7d10a50ed954728399c50de2f05db69

Contents?: true

Size: 928 Bytes

Versions: 3

Compression:

Stored size: 928 Bytes

Contents

require "spec_helper"

describe OmniAuth::Strategies::OAuth2 do
  def app; lambda { |_env| [200, {}, ["Hello."]] } end

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

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

  after do
    OmniAuth.config.test_mode = false
  end

  context "client options" do
    it "has correct api site" do
      expect(subject.options.client_options.site).to eq("https://canvas.instructure.com")
    end

    it "has correct access token path" do
      expect(subject.options.client_options.token_url).to eq("/login/oauth2/token")
    end

    it "has correct authorize url" do
      expect(subject.options.client_options.authorize_url).to eq("/login/oauth2/auth")
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
omniauth-canvas-1.0.1 spec/omniauth/strategies/canvas_spec.rb
omniauth-canvas-1.0.0 spec/omniauth/strategies/canvas_spec.rb
omniauth-canvas-0.1.3 spec/omniauth/strategies/canvas_spec.rb