diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-01-22 18:10:26 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-01-22 18:10:26 +0000 |
commit | 52621c697d60f1aac2694e097b732b9df51ee8a8 (patch) | |
tree | 16fc605e908ef52463e496b04468157183916ffa /test/unit/auth_source_ldap_test.rb | |
parent | ceb476a7c5d53f7b52b1dc1d8f5af24b5c6e95ee (diff) | |
download | redmine-52621c697d60f1aac2694e097b732b9df51ee8a8.tar.gz redmine-52621c697d60f1aac2694e097b732b9df51ee8a8.zip |
Makes the test LDAP host configurable (#21674).
git-svn-id: http://svn.redmine.org/redmine/trunk@15088 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/auth_source_ldap_test.rb')
-rw-r--r-- | test/unit/auth_source_ldap_test.rb | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/test/unit/auth_source_ldap_test.rb b/test/unit/auth_source_ldap_test.rb index 0126c1e5e..fefac2e07 100644 --- a/test/unit/auth_source_ldap_test.rb +++ b/test/unit/auth_source_ldap_test.rb @@ -156,11 +156,9 @@ class AuthSourceLdapTest < ActiveSupport::TestCase assert_equal [], results end - def test_ldap_with_correct_host + def test_ldap_with_correct_host_and_port auth_source = AuthSourceLdap.find(1) - assert_equal "127.0.0.1", auth_source.host - assert_equal 389, auth_source.port assert_nothing_raised Net::LDAP::Error do auth_source.test_connection end @@ -171,30 +169,16 @@ class AuthSourceLdapTest < ActiveSupport::TestCase auth_source.host = "badhost" auth_source.save! - assert_equal "badhost", auth_source.host - assert_equal 389, auth_source.port assert_raise Net::LDAP::Error do auth_source.test_connection end end - def test_ldap_with_correct_port - auth_source = AuthSourceLdap.find(1) - - assert_equal "127.0.0.1", auth_source.host - assert_equal 389, auth_source.port - assert_nothing_raised Net::LDAP::Error do - auth_source.test_connection - end - end - def test_ldap_with_incorrect_port auth_source = AuthSourceLdap.find(1) auth_source.port = 1234 auth_source.save! - assert_equal "127.0.0.1", auth_source.host - assert_equal 1234, auth_source.port assert_raise Net::LDAP::Error do auth_source.test_connection end @@ -206,8 +190,6 @@ class AuthSourceLdapTest < ActiveSupport::TestCase auth_source.account_password = "secret" auth_source.save! - assert_equal "127.0.0.1", auth_source.host - assert_equal 389, auth_source.port assert_equal "cn=admin,dc=redmine,dc=org", auth_source.account assert_equal "secret", auth_source.account_password assert_nil auth_source.test_connection @@ -216,8 +198,6 @@ class AuthSourceLdapTest < ActiveSupport::TestCase def test_ldap_bind_without_account_and_password auth_source = AuthSourceLdap.find(1) - assert_equal "127.0.0.1", auth_source.host - assert_equal 389, auth_source.port assert_nil auth_source.account assert_equal "", auth_source.account_password assert_nil auth_source.test_connection @@ -229,8 +209,6 @@ class AuthSourceLdapTest < ActiveSupport::TestCase auth_source.account_password = "secret" auth_source.save! - assert_equal "127.0.0.1", auth_source.host - assert_equal 389, auth_source.port assert_equal "cn=baduser,dc=redmine,dc=org", auth_source.account assert_equal "secret", auth_source.account_password assert_raise AuthSourceException do @@ -244,8 +222,6 @@ class AuthSourceLdapTest < ActiveSupport::TestCase auth_source.account_password = "badpassword" auth_source.save! - assert_equal "127.0.0.1", auth_source.host - assert_equal 389, auth_source.port assert_equal "cn=admin,dc=redmine,dc=org", auth_source.account assert_equal "badpassword", auth_source.account_password assert_raise AuthSourceException do |