@@ -156,7 +156,7 class AuthSourceLdapTest < ActiveSupport::TestCase | |||||
156 | assert_equal [], results |
|
156 | assert_equal [], results | |
157 | end |
|
157 | end | |
158 |
|
158 | |||
159 |
def test_ |
|
159 | def test_test_connection_with_correct_host_and_port | |
160 | auth_source = AuthSourceLdap.find(1) |
|
160 | auth_source = AuthSourceLdap.find(1) | |
161 |
|
161 | |||
162 | assert_nothing_raised Net::LDAP::Error do |
|
162 | assert_nothing_raised Net::LDAP::Error do | |
@@ -164,7 +164,7 class AuthSourceLdapTest < ActiveSupport::TestCase | |||||
164 | end |
|
164 | end | |
165 | end |
|
165 | end | |
166 |
|
166 | |||
167 |
def test_ |
|
167 | def test_test_connection_with_incorrect_host | |
168 | auth_source = AuthSourceLdap.find(1) |
|
168 | auth_source = AuthSourceLdap.find(1) | |
169 | auth_source.host = "badhost" |
|
169 | auth_source.host = "badhost" | |
170 | auth_source.save! |
|
170 | auth_source.save! | |
@@ -174,7 +174,7 class AuthSourceLdapTest < ActiveSupport::TestCase | |||||
174 | end |
|
174 | end | |
175 | end |
|
175 | end | |
176 |
|
176 | |||
177 |
def test_ |
|
177 | def test_test_connection_with_incorrect_port | |
178 | auth_source = AuthSourceLdap.find(1) |
|
178 | auth_source = AuthSourceLdap.find(1) | |
179 | auth_source.port = 1234 |
|
179 | auth_source.port = 1234 | |
180 | auth_source.save! |
|
180 | auth_source.save! | |
@@ -184,7 +184,7 class AuthSourceLdapTest < ActiveSupport::TestCase | |||||
184 | end |
|
184 | end | |
185 | end |
|
185 | end | |
186 |
|
186 | |||
187 |
def test_ |
|
187 | def test_test_connection_bind_with_account_and_password | |
188 | auth_source = AuthSourceLdap.find(1) |
|
188 | auth_source = AuthSourceLdap.find(1) | |
189 | auth_source.account = "cn=admin,dc=redmine,dc=org" |
|
189 | auth_source.account = "cn=admin,dc=redmine,dc=org" | |
190 | auth_source.account_password = "secret" |
|
190 | auth_source.account_password = "secret" | |
@@ -195,7 +195,7 class AuthSourceLdapTest < ActiveSupport::TestCase | |||||
195 | assert_nil auth_source.test_connection |
|
195 | assert_nil auth_source.test_connection | |
196 | end |
|
196 | end | |
197 |
|
197 | |||
198 |
def test_ |
|
198 | def test_test_connection_bind_without_account_and_password | |
199 | auth_source = AuthSourceLdap.find(1) |
|
199 | auth_source = AuthSourceLdap.find(1) | |
200 |
|
200 | |||
201 | assert_nil auth_source.account |
|
201 | assert_nil auth_source.account | |
@@ -203,7 +203,7 class AuthSourceLdapTest < ActiveSupport::TestCase | |||||
203 | assert_nil auth_source.test_connection |
|
203 | assert_nil auth_source.test_connection | |
204 | end |
|
204 | end | |
205 |
|
205 | |||
206 |
def test_ |
|
206 | def test_test_connection_bind_with_incorrect_account | |
207 | auth_source = AuthSourceLdap.find(1) |
|
207 | auth_source = AuthSourceLdap.find(1) | |
208 | auth_source.account = "cn=baduser,dc=redmine,dc=org" |
|
208 | auth_source.account = "cn=baduser,dc=redmine,dc=org" | |
209 | auth_source.account_password = "secret" |
|
209 | auth_source.account_password = "secret" | |
@@ -216,7 +216,7 class AuthSourceLdapTest < ActiveSupport::TestCase | |||||
216 | end |
|
216 | end | |
217 | end |
|
217 | end | |
218 |
|
218 | |||
219 |
def test_ |
|
219 | def test_test_connection_bind_with_incorrect_password | |
220 | auth_source = AuthSourceLdap.find(1) |
|
220 | auth_source = AuthSourceLdap.find(1) | |
221 | auth_source.account = "cn=admin,dc=redmine,dc=org" |
|
221 | auth_source.account = "cn=admin,dc=redmine,dc=org" | |
222 | auth_source.account_password = "badpassword" |
|
222 | auth_source.account_password = "badpassword" |
General Comments 0
You need to be logged in to leave comments.
Login now