diff options
author | Robert Speicher <rspeicher@gmail.com> | 2018-06-19 15:45:39 -0500 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2018-06-19 15:45:39 -0500 |
commit | 73ade323c8993451199a965ec2330d9c7334c2e2 (patch) | |
tree | efa91c7a68e41ce1e69ba496d96bbd27dc22ca29 /spec/support/helpers | |
parent | e0da61bca80485b99f78ef1dbb3c64578d64d55a (diff) | |
download | gitlab-ce-73ade323c8993451199a965ec2330d9c7334c2e2.tar.gz |
Make the stubbed methods for SAML authorize paths more specificrs-platform-feature-spec-parity
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
Diffstat (limited to 'spec/support/helpers')
-rw-r--r-- | spec/support/helpers/login_helpers.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/spec/support/helpers/login_helpers.rb b/spec/support/helpers/login_helpers.rb index f7b71bf42e3..329f18cd288 100644 --- a/spec/support/helpers/login_helpers.rb +++ b/spec/support/helpers/login_helpers.rb @@ -152,8 +152,13 @@ module LoginHelpers end 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(Object).to receive(:omniauth_authorize_path).with(:user, "saml").and_return('/users/auth/saml') + allow_any_instance_of(ActionDispatch::Routing::RoutesProxy) + .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 def stub_omniauth_config(messages) |