summaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/auth_source_ldap_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/unit/auth_source_ldap_test.rb b/test/unit/auth_source_ldap_test.rb
index 783ea6faf..60558f798 100644
--- a/test/unit/auth_source_ldap_test.rb
+++ b/test/unit/auth_source_ldap_test.rb
@@ -114,6 +114,16 @@ class AuthSourceLdapTest < ActiveSupport::TestCase
end
end
end
+
+ def test_authenticate_should_timeout
+ auth_source = AuthSourceLdap.find(1)
+ auth_source.timeout = 1
+ def auth_source.initialize_ldap_con(*args); sleep(5); end
+
+ assert_raise AuthSourceTimeoutException do
+ auth_source.authenticate 'example1', '123456'
+ end
+ end
else
puts '(Test LDAP server not configured)'
end