Module: OmniAuth::Test::StrategyTestCase
- Defined in:
- lib/omniauth/test/strategy_test_case.rb
Overview
Support for testing OmniAuth strategies.
Instance Method Summary collapse
Instance Method Details
#app ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/omniauth/test/strategy_test_case.rb', line 20 def app strat = strategy resp = app_response Rack::Builder.new do use(OmniAuth::Test::PhonySession) use(*strat) run lambda { |env| [404, {'Content-Type' => 'text/plain'}, [resp || env.key?('omniauth.auth').to_s]] } end.to_app end |
#app_response ⇒ Object
30 31 32 |
# File 'lib/omniauth/test/strategy_test_case.rb', line 30 def app_response nil end |
#session ⇒ Object
34 35 36 |
# File 'lib/omniauth/test/strategy_test_case.rb', line 34 def session last_request.env['rack.session'] end |
#strategy ⇒ Object
38 39 40 41 |
# File 'lib/omniauth/test/strategy_test_case.rb', line 38 def strategy error = NotImplementedError.new('Including specs must define #strategy') raise(error) end |