From ae84eaeba7d450953a9f20d7085541cd1ff4200b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Javier=20L=C3=B3pez?= Date: Wed, 4 Apr 2018 09:07:28 +0000 Subject: Add better LDAP connection handling --- spec/support/ldap_helpers.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'spec/support/ldap_helpers.rb') 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 -- cgit v1.2.1