summaryrefslogtreecommitdiffstats
path: root/test/unit/auth_source_ldap_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-07-07 09:36:04 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-07-07 09:36:04 +0000
commit3b207ee77caf47953fb436099b384099c97ff16b (patch)
treed849bcd26968b13467f66cb4b9e7b1cc4c38043e /test/unit/auth_source_ldap_test.rb
parent553066e804dd5796ac4f8d1d775cfeb5670d239f (diff)
downloadredmine-3b207ee77caf47953fb436099b384099c97ff16b.tar.gz
redmine-3b207ee77caf47953fb436099b384099c97ff16b.zip
Adds a configurable timeout for LDAP authentication (#8978).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9931 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/auth_source_ldap_test.rb')
-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