File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,10 @@ def authorize_params
5151 options . authorize_params [ :state ] = 3 . times . map { rand . to_s [ 2 ..-1 ] } . reduce ( &:concat )
5252 end
5353 params = options . authorize_params . merge ( options . authorize_options . inject ( { } ) { |h , k | h [ k . to_sym ] = options [ k ] if options [ k ] ; h } )
54+ if OmniAuth . config . test_mode
55+ @env ||= { }
56+ @env [ 'rack.session' ] ||= { }
57+ end
5458 session [ 'omniauth.state' ] = params [ :state ]
5559 params
5660 end
Original file line number Diff line number Diff line change 44 def app ; lambda { |env | [ 200 , { } , [ "Hello." ] ] } end
55 let ( :fresh_strategy ) { Class . new ( OmniAuth ::Strategies ::OAuth2 ) }
66
7+ before do
8+ OmniAuth . config . test_mode = true
9+ end
10+
11+ after do
12+ OmniAuth . config . test_mode = false
13+ end
14+
715 describe '#client' do
816 subject { fresh_strategy }
917
You can’t perform that action at this time.
0 commit comments