Sha256: 6fcdf55fdd6580207d1c67f167479fc315e95d836a09d033be5f80f3706a6d7b

Contents?: true

Size: 966 Bytes

Versions: 5

Compression:

Stored size: 966 Bytes

Contents

# NOTE it would be useful if this lived in omniauth-oauth2 eventually
shared_examples 'an oauth2 strategy' do
  describe '#client' do
    it 'should be initialized with symbolized client_options' do
      @options = { :client_options => { 'authorize_url' => 'https://example.com' } }
      subject.client.options[:authorize_url].should == 'https://example.com'
    end
  end

  describe '#token_params' do
    it 'should include any authorize params passed in the :authorize_params option' do
      @options = { :token_params => { :foo => 'bar', :baz => 'zip' } }
      subject.token_params['foo'].should eq('bar')
      subject.token_params['baz'].should eq('zip')
    end

    it 'should include top-level options that are marked as :authorize_options' do
      @options = { :token_options => [:scope, :foo], :scope => 'bar', :foo => 'baz' }
      subject.token_params['scope'].should eq('bar')
      subject.token_params['foo'].should eq('baz')
    end
  end
end

Version data entries

5 entries across 5 versions & 5 rubygems

Version Path
omniauth-surveymonkey-oauth2-1.0.1 spec/support/shared_examples.rb
omniauth-burner-1.0.1 spec/support/shared_examples.rb
omniauth-acton-1.0.1 spec/support/shared_examples.rb
omniauth-basecrm-1.0.0 spec/support/shared_examples.rb
omniauth-gust-0.1.1 spec/support/shared_examples.rb