Skip to content

Commit 5b8dfd9

Browse files
committed
Add integration test for adding a person entry
1 parent af00993 commit 5b8dfd9

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

test/integration/test_add.rb

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
require_relative '../test_helper'
2+
3+
class TestAddIntegration < LDAPIntegrationTestCase
4+
def setup
5+
super
6+
@ldap.authenticate "cn=admin,dc=rubyldap,dc=com", "passworD1"
7+
8+
@dn = "uid=added-user1,ou=People,dc=rubyldap,dc=com"
9+
end
10+
11+
def test_add
12+
attrs = {
13+
objectclass: %w(top inetOrgPerson organizationalPerson person),
14+
uid: "added-user1",
15+
cn: "added-user1",
16+
sn: "added-user1",
17+
18+
}
19+
20+
assert @ldap.add(dn: @dn, attributes: attrs), @ldap.get_operation_result.inspect
21+
22+
assert result = @ldap.search(base: @dn, scope: Net::LDAP::SearchScope_BaseObject).first
23+
end
24+
25+
def teardown
26+
@ldap.delete dn: @dn
27+
end
28+
end

0 commit comments

Comments
 (0)