Commit 73ade323 authored by Robert Speicher's avatar Robert Speicher

Make the stubbed methods for SAML authorize paths more specific

Globally stubbing any instance of `Object` seems like a very bad idea,
and it led to test failures here:

- https://gitlab.com/gitlab-org/gitlab-ee/-/jobs/76025159
- https://gitlab.com/gitlab-org/gitlab-ee/-/jobs/76024972
parent e0da61bc
...@@ -152,8 +152,13 @@ module LoginHelpers ...@@ -152,8 +152,13 @@ module LoginHelpers
end end
def stub_saml_authorize_path_helpers def stub_saml_authorize_path_helpers
allow_any_instance_of(Object).to receive(:user_saml_omniauth_authorize_path).and_return('/users/auth/saml') allow_any_instance_of(ActionDispatch::Routing::RoutesProxy)
allow_any_instance_of(Object).to receive(:omniauth_authorize_path).with(:user, "saml").and_return('/users/auth/saml') .to receive(:user_saml_omniauth_authorize_path)
.and_return('/users/auth/saml')
allow(Devise::OmniAuth::UrlHelpers)
.to receive(:omniauth_authorize_path)
.with(:user, "saml")
.and_return('/users/auth/saml')
end end
def stub_omniauth_config(messages) def stub_omniauth_config(messages)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment