summaryrefslogtreecommitdiff
path: root/spec/support/ldap_helpers.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/ldap_helpers.rb')
-rw-r--r--spec/support/ldap_helpers.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/support/ldap_helpers.rb b/spec/support/ldap_helpers.rb
index 081ce0ad7b7..0e87b3d359d 100644
--- a/spec/support/ldap_helpers.rb
+++ b/spec/support/ldap_helpers.rb
@@ -41,4 +41,9 @@ module LdapHelpers
entry
end
+
+ def raise_ldap_connection_error
+ allow_any_instance_of(Gitlab::Auth::LDAP::Adapter)
+ .to receive(:ldap_search).and_raise(Gitlab::Auth::LDAP::LDAPConnectionError)
+ end
end