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
23 24 25 26 27 28 29 30 31 |
# File 'lib/omniauth/test/strategy_test_case.rb', line 23 def app strat = self.strategy resp = self.app_response Rack::Builder.new { use OmniAuth::Test::PhonySession use *strat run lambda {|env| [404, {'Content-Type' => 'text/plain'}, [resp || env.key?('omniauth.auth').to_s]] } }.to_app end |
#app_response ⇒ Object
33 34 35 |
# File 'lib/omniauth/test/strategy_test_case.rb', line 33 def app_response nil end |
#session ⇒ Object
37 38 39 |
# File 'lib/omniauth/test/strategy_test_case.rb', line 37 def session last_request.env['rack.session'] end |
#strategy ⇒ Object
41 42 43 |
# File 'lib/omniauth/test/strategy_test_case.rb', line 41 def strategy raise NotImplementedError.new('Including specs must define #strategy') end |