Skip to content
Browse files

Merge pull request #413 from whilefalse/master

Maintain query string parameters in test mode.
  • Loading branch information...
2 parents 95802bf + a20c0a9 commit 43ef8d9b74cd20321e7945307c59b537787933b9 @sferik sferik committed Sep 3, 2011
Showing with 6 additions and 1 deletion.
  1. +1 −1 oa-core/lib/omniauth/strategy.rb
  2. +5 −0 oa-core/spec/omniauth/strategy_spec.rb
View
2 oa-core/lib/omniauth/strategy.rb
@@ -95,7 +95,7 @@ def mock_request_call
elsif env['HTTP_REFERER'] && !env['HTTP_REFERER'].match(/#{request_path}$/)
@env['rack.session']['omniauth.origin'] = env['HTTP_REFERER']
end
- redirect(script_name + callback_path)
+ redirect(script_name + callback_path + query_string)
end
def mock_callback_call
View
5 oa-core/spec/omniauth/strategy_spec.rb
@@ -267,6 +267,11 @@ def make_env(path = '/auth/test', props = {})
strategy.call(make_env('/AUTH/TeSt/CaLlBAck')).should == strategy.call(make_env('/auth/test/callback'))
end
+ it 'should maintain query string parameters' do
+ response = strategy.call(make_env('/auth/test', 'QUERY_STRING' => 'cheese=stilton'))
+ response[1]['Location'].should == '/auth/test/callback?cheese=stilton'
+ end
+
it 'should not short circuit requests outside of authentication' do
strategy.call(make_env('/')).should == app.call(make_env('/'))
end

0 comments on commit 43ef8d9

Please sign in to comment.
Something went wrong with that request. Please try again.