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 |
# File 'lib/omniauth/test/strategy_test_case.rb', line 23 def app strategy = self.strategy Rack::Builder.new { use OmniAuth::Test::PhonySession use *strategy run lambda { |env| [200, {'Content-Type' => 'text/plain'}, [Rack::Request.new(env).params.key?('auth').to_s]] } }.to_app end |
#session ⇒ Object
32 33 34 |
# File 'lib/omniauth/test/strategy_test_case.rb', line 32 def session last_request.env['rack.session'] end |
#strategy ⇒ Object
36 37 38 |
# File 'lib/omniauth/test/strategy_test_case.rb', line 36 def strategy raise NotImplementedError.new('Including specs must define #strategy') end |