summaryrefslogtreecommitdiff
path: root/spec/support/login_helpers.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/login_helpers.rb')
-rw-r--r--spec/support/login_helpers.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/support/login_helpers.rb b/spec/support/login_helpers.rb
index 3e117530151..4aed40bf22d 100644
--- a/spec/support/login_helpers.rb
+++ b/spec/support/login_helpers.rb
@@ -120,4 +120,16 @@ module LoginHelpers
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')
end
+
+ def stub_omniauth_config(messages)
+ allow(Gitlab.config.omniauth).to receive_messages(messages)
+ end
+
+ def stub_basic_saml_config
+ allow(Gitlab::Saml::Config).to receive_messages({ options: { name: 'saml', args: {} } })
+ end
+
+ def stub_saml_group_config(groups)
+ allow(Gitlab::Saml::Config).to receive_messages({ options: { name: 'saml', groups_attribute: 'groups', external_groups: groups, args: {} } })
+ end
end