Sha256: 864a73f6db2db67cadc3d62b2e0435cb12a89fe00464e024576231dffcce708b

Contents?: true

Size: 871 Bytes

Versions: 7

Compression:

Stored size: 871 Bytes

Contents

require 'spec_helper'

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

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

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

  after do
    OmniAuth.config.test_mode = false
  end

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

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

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

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
omniauth-canvas-0.1.2 spec/omniauth/strategies/canvas_spec.rb
omniauth-canvas-0.1.1 spec/omniauth/strategies/canvas_spec.rb
omniauth-canvas-0.1.0 spec/omniauth/strategies/canvas_spec.rb
omniauth-canvas-0.0.4 spec/omniauth/strategies/canvas_spec.rb
omniauth-canvas-0.0.3 spec/omniauth/strategies/canvas_spec.rb
omniauth-canvas-0.0.2 spec/omniauth/strategies/canvas_spec.rb
omniauth-canvas-0.0.1 spec/omniauth/strategies/canvas_spec.rb