Skip to content

Commit cb5f0ef

Browse files
committed
Expect anonymous auth to fail
1 parent a1978eb commit cb5f0ef

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

test/test_integration.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,15 @@ def test_bind_success
2020
assert @ldap.bind(method: :simple, username: "uid=user1,ou=People,dc=rubyldap,dc=com", password: "passworD1"), @ldap.get_operation_result.inspect
2121
end
2222

23-
def test_bind_success_anonymous
24-
assert @ldap.bind(method: :simple, username: "uid=user1,ou=People,dc=rubyldap,dc=com", password: ""), @ldap.get_operation_result.inspect
23+
def test_bind_anonymous_fail
24+
refute @ldap.bind(method: :simple, username: "uid=user1,ou=People,dc=rubyldap,dc=com", password: ""), @ldap.get_operation_result.inspect
25+
26+
result = @ldap.get_operation_result
27+
assert_equal 53, result.code
28+
assert_equal "Unwilling to perform", result.message
29+
assert_equal "unauthenticated bind (DN with no password) disallowed",
30+
result.error_message
31+
assert_equal "", result.matched_dn
2532
end
2633

2734
def test_bind_fail

0 commit comments

Comments
 (0)