summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-02-19 18:13:46 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-02-19 18:13:46 +0000
commit3e3d7c8d4f4f93fae3c81eb20a13af8fbe3600ef (patch)
treea9a0ac4d40f0ab414e8e6d1221912e850fcccb94 /test
parent59c2530001b49e3acfa36672c2ffc91eba5923c5 (diff)
downloadredmine-3e3d7c8d4f4f93fae3c81eb20a13af8fbe3600ef.tar.gz
redmine-3e3d7c8d4f4f93fae3c81eb20a13af8fbe3600ef.zip
Friendly response when the LDAP connection fails.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8911 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/functional/account_controller_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/functional/account_controller_test.rb b/test/functional/account_controller_test.rb
index 00142ffd0..5bf65b9ab 100644
--- a/test/functional/account_controller_test.rb
+++ b/test/functional/account_controller_test.rb
@@ -51,6 +51,16 @@ class AccountControllerTest < ActionController::TestCase
:content => /Invalid user or password/
end
+ def test_login_should_rescue_auth_source_exception
+ source = AuthSource.create!(:name => 'Test')
+ User.find(2).update_attribute :auth_source_id, source.id
+ AuthSource.any_instance.stubs(:authenticate).raises(AuthSourceException.new("Something wrong"))
+
+ post :login, :username => 'jsmith', :password => 'jsmith'
+ assert_response 500
+ assert_error_tag :content => /Something wrong/
+ end
+
if Object.const_defined?(:OpenID)
def test_login_with_openid_for_existing_user