mirror of
https://github.com/omniauth/omniauth.git
synced 2022-11-09 12:31:49 -05:00
added OmniAuth::Test package with PhonySession for test support
This commit is contained in:
parent
7691e0c295
commit
9402f6eb5e
3 changed files with 19 additions and 0 deletions
|
@ -6,6 +6,7 @@ module OmniAuth
|
|||
|
||||
autoload :Builder, 'omniauth/builder'
|
||||
autoload :Strategy, 'omniauth/strategy'
|
||||
autoload :Test, 'omniauth/test'
|
||||
|
||||
module Strategies
|
||||
autoload :Password, 'omniauth/strategies/password'
|
||||
|
|
10
oa-core/lib/omniauth/test.rb
Normal file
10
oa-core/lib/omniauth/test.rb
Normal file
|
@ -0,0 +1,10 @@
|
|||
module OmniAuth
|
||||
|
||||
# Support for testing OmniAuth strategies.
|
||||
module Test
|
||||
|
||||
autoload :PhonySession, 'omniauth/test/phony_session'
|
||||
|
||||
end
|
||||
|
||||
end
|
8
oa-core/lib/omniauth/test/phony_session.rb
Normal file
8
oa-core/lib/omniauth/test/phony_session.rb
Normal file
|
@ -0,0 +1,8 @@
|
|||
class OmniAuth::Test::PhonySession
|
||||
def initialize(app); @app = app end
|
||||
def call(env)
|
||||
@session ||= (env['rack.session'] || {})
|
||||
env['rack.session'] = @session
|
||||
@app.call(env)
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue