Sha256: 453413886ba745c18f2498def07dd0a4a3cf769a410d4ed0525bec598ff9caea

Contents?: true

Size: 1.24 KB

Versions: 9

Compression:

Stored size: 1.24 KB

Contents

shared_examples_for "an oauth strategy" do
  it 'should be initializable with only three arguments' do
    lambda{ strategy_class.new(lambda{|env| [200, {}, ['Hello World']]}, 'key', 'secret') }.should_not raise_error
  end
  
  it 'should be initializable with a block' do
    lambda{ strategy_class.new(lambda{|env| [200, {}, ['Hello World']]}){|s| s.consumer_key = 'abc'} }.should_not raise_error
  end

  it 'should handle the setting of client options' do
    s = strategy_class.new(lambda{|env| [200, {}, ['Hello World']]}, 'key', 'secret', :client_options => {:abc => 'def'})
    s.consumer.options[:abc].should == 'def'
  end
end

shared_examples_for "an oauth2 strategy" do
  it 'should be initializable with only three arguments' do
    lambda{ strategy_class.new(lambda{|env| [200, {}, ['Hello World']]}, 'key', 'secret') }.should_not raise_error
  end
  
  it 'should be initializable with a block' do
    lambda{ strategy_class.new(lambda{|env| [200, {}, ['Hello World']]}){|s| s.client_id = 'abc'} }.should_not raise_error
  end

  it 'should handle the setting of client options' do
    s = strategy_class.new(lambda{|env| [200, {}, ['Hello World']]}, 'key', 'secret', :client_options => {:abc => 'def'})
    s.client.options[:abc].should == 'def'
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
omniauth_china-0.1.1 spec/support/shared_examples.rb
omniauth_china-0.1.0 spec/support/shared_examples.rb
omniauth_china-0.0.7 spec/support/shared_examples.rb
oa-oauth-0.2.4 spec/support/shared_examples.rb
omniauth_china-0.0.6 spec/support/shared_examples.rb
omniauth_china-0.0.5 spec/support/shared_examples.rb
omniauth_china-0.0.4.beta1 spec/support/shared_examples.rb
omniauth_china-0.0.4 spec/support/shared_examples.rb
omniauth_china-0.0.3 spec/support/shared_examples.rb