| 197 |
197 |
assert_equal [], results
|
| 198 |
198 |
end
|
| 199 |
199 |
|
| 200 |
|
def test_test_connection_with_correct_host_and_port
|
| 201 |
|
auth_source = AuthSourceLdap.find(1)
|
| 202 |
|
|
| 203 |
|
assert_nothing_raised do
|
| 204 |
|
auth_source.test_connection
|
| 205 |
|
end
|
| 206 |
|
end
|
| 207 |
|
|
| 208 |
200 |
def test_test_connection_with_incorrect_host
|
| 209 |
201 |
auth_source = AuthSourceLdap.find(1)
|
| 210 |
202 |
auth_source.host = "badhost"
|
| ... | ... | |
| 233 |
225 |
|
| 234 |
226 |
assert_equal "cn=admin,dc=redmine,dc=org", auth_source.account
|
| 235 |
227 |
assert_equal "secret", auth_source.account_password
|
| 236 |
|
assert_nil auth_source.test_connection
|
|
228 |
assert_nothing_raised do
|
|
229 |
auth_source.test_connection
|
|
230 |
end
|
|
231 |
end
|
|
232 |
|
|
233 |
def test_test_connection_bind_with_dynamic_bind_account
|
|
234 |
auth_source = AuthSourceLdap.find(1)
|
|
235 |
auth_source.account = "cn=$login,dc=redmine,dc=org"
|
|
236 |
auth_source.save!
|
|
237 |
|
|
238 |
assert_equal "cn=$login,dc=redmine,dc=org", auth_source.account
|
|
239 |
assert_nothing_raised do
|
|
240 |
auth_source.test_connection
|
|
241 |
end
|
| 237 |
242 |
end
|
| 238 |
243 |
|
| 239 |
244 |
def test_test_connection_bind_without_account_and_password
|
| ... | ... | |
| 241 |
246 |
|
| 242 |
247 |
assert_nil auth_source.account
|
| 243 |
248 |
assert_equal "", auth_source.account_password
|
| 244 |
|
assert_nil auth_source.test_connection
|
|
249 |
assert_raise AuthSourceException do
|
|
250 |
auth_source.test_connection
|
|
251 |
end
|
| 245 |
252 |
end
|
| 246 |
253 |
|
| 247 |
254 |
def test_test_connection_bind_with_incorrect_account
|