Sha256: 2de3063b11f0037d85240a6248286973332fe0364efb034846f2f8686c9dda83

Contents?: true

Size: 1.62 KB

Versions: 30

Compression:

Stored size: 1.62 KB

Contents

# NOTE it would be useful if this lived in omniauth-oauth2 eventually
# Thanks to Josh Ellithorpe for this file -Will

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 '#authorize_params' do
    # it 'should include any authorize params passed in the :authorize_params option' do
    #   @options = { :authorize_params => { :foo => 'bar', :baz => 'zip' } }
    #   p subject.authorize_params
    #   subject.authorize_params['foo'].should eq('bar')
    #   subject.authorize_params['baz'].should eq('zip')
    # end

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

  describe '#token_params' do
    it 'should include any token params passed in the :token_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 :token_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

30 entries across 30 versions & 1 rubygems

Version Path
dailycred-0.3.1 spec/support/shared_examples.rb
dailycred-0.3.0 spec/support/shared_examples.rb
dailycred-0.2.0 spec/support/shared_examples.rb
dailycred-0.1.8 spec/support/shared_examples.rb
dailycred-0.1.7 spec/support/shared_examples.rb
dailycred-0.1.6 spec/support/shared_examples.rb
dailycred-0.1.5 spec/support/shared_examples.rb
dailycred-0.1.461 spec/support/shared_examples.rb
dailycred-0.1.46 spec/support/shared_examples.rb
dailycred-0.1.45 spec/support/shared_examples.rb
dailycred-0.1.44 spec/support/shared_examples.rb
dailycred-0.1.43 spec/support/shared_examples.rb
dailycred-0.1.42 spec/support/shared_examples.rb
dailycred-0.1.41 spec/support/shared_examples.rb
dailycred-0.1.4 spec/support/shared_examples.rb
dailycred-0.1.36 spec/support/shared_examples.rb
dailycred-0.1.35 spec/support/shared_examples.rb
dailycred-0.1.34 spec/support/shared_examples.rb
dailycred-0.1.33 spec/support/shared_examples.rb
dailycred-0.1.32 spec/support/shared_examples.rb