diff options
Diffstat (limited to 'spec/support/omniauth_strategy.rb')
-rw-r--r-- | spec/support/omniauth_strategy.rb | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/spec/support/omniauth_strategy.rb b/spec/support/omniauth_strategy.rb index 23907b8e450..5d5ee7dc1db 100644 --- a/spec/support/omniauth_strategy.rb +++ b/spec/support/omniauth_strategy.rb @@ -6,12 +6,6 @@ module StrategyHelpers include Shoulda::Matchers::ActionController include OmniAuth::Test::StrategyTestCase - def post(*args) - super.tap do - @response = ActionDispatch::TestResponse.from_response(last_response) - end - end - def auth_hash last_request.env['omniauth.auth'] end @@ -21,7 +15,9 @@ module StrategyHelpers original_on_failure = OmniAuth.config.on_failure OmniAuth.config.test_mode = false - OmniAuth.config.on_failure = OmniAuth::FailureEndpoint + OmniAuth.config.on_failure = proc do |env| + OmniAuth::FailureEndpoint.new(env).redirect_to_failure + end yield ensure @@ -33,7 +29,7 @@ end RSpec.configure do |config| config.include StrategyHelpers, type: :strategy - config.around(:all, type: :strategy) do |example| + config.around(type: :strategy) do |example| StrategyHelpers.without_test_mode do example.run end |