Skip to content

Commit 8cdcc08

Browse files
committed
Merge branch 'topic-fix-state-specs' of github.com:jjulian/omniauth-oauth2 into jjulian-topic-fix-state-specs
2 parents d6409bb + 5eb5ee0 commit 8cdcc08

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

spec/omniauth/strategies/oauth2_spec.rb

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def app; lambda{|env| [200, {}, ["Hello."]]} end
1414

1515
describe '#client' do
1616
subject{ fresh_strategy }
17-
17+
1818
it 'should be initialized with symbolized client_options' do
1919
instance = subject.new(app, :client_options => {'authorize_url' => 'https://example.com'})
2020
instance.client.options[:authorize_url].should == 'https://example.com'
@@ -30,20 +30,21 @@ def app; lambda{|env| [200, {}, ["Hello."]]} end
3030
subject { fresh_strategy }
3131

3232
it 'should include any authorize params passed in the :authorize_params option' do
33-
instance = subject.new('abc', 'def', :authorize_params => {:foo => 'bar', :baz => 'zip', :state => '123'})
34-
instance.authorize_params.should == {'foo' => 'bar', 'baz' => 'zip', 'state' => '123'}
33+
instance = subject.new('abc', 'def', :authorize_params => {:foo => 'bar', :baz => 'zip'})
34+
instance.authorize_params['foo'].should == 'bar'
35+
instance.authorize_params['baz'].should == 'zip'
3536
end
3637

3738
it 'should include top-level options that are marked as :authorize_options' do
38-
instance = subject.new('abc', 'def', :authorize_options => [:scope, :foo], :scope => 'bar', :foo => 'baz', :authorize_params => {:state => '123'})
39-
instance.authorize_params.should == {'scope' => 'bar', 'foo' => 'baz', 'state' => '123'}
39+
instance = subject.new('abc', 'def', :authorize_options => [:scope, :foo, :state], :scope => 'bar', :foo => 'baz')
40+
instance.authorize_params['scope'].should == 'bar'
41+
instance.authorize_params['foo'].should == 'baz'
4042
end
4143

4244
it 'should include random state in the authorize params' do
4345
instance = subject.new('abc', 'def')
4446
instance.authorize_params.keys.should == ['state']
4547
instance.session['omniauth.state'].should_not be_empty
46-
instance.session['omniauth.state'].should == instance.authorize_params['state']
4748
end
4849
end
4950

0 commit comments

Comments
 (0)