summaryrefslogtreecommitdiff
path: root/spec/support/omniauth_strategy.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-07-20 09:55:51 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-07-20 09:55:51 +0000
commite8d2c2579383897a1dd7f9debd359abe8ae8373d (patch)
treec42be41678c2586d49a75cabce89322082698334 /spec/support/omniauth_strategy.rb
parentfc845b37ec3a90aaa719975f607740c22ba6a113 (diff)
downloadgitlab-ce-e8d2c2579383897a1dd7f9debd359abe8ae8373d.tar.gz
Add latest changes from gitlab-org/gitlab@14-1-stable-eev14.1.0-rc42
Diffstat (limited to 'spec/support/omniauth_strategy.rb')
-rw-r--r--spec/support/omniauth_strategy.rb12
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