Sha256: c29076150bd746e20a5a940c5dc5cd8ccb5693376b9316720f2575b5dbd6b915

Contents?: true

Size: 1.05 KB

Versions: 4

Compression:

Stored size: 1.05 KB

Contents

require_relative '../test_helper'

class TestDeleteIntegration < LDAPIntegrationTestCase
  def setup
    super
    @ldap.authenticate "cn=admin,dc=rubyldap,dc=com", "passworD1"

    @dn = "uid=delete-user1,ou=People,dc=rubyldap,dc=com"

    attrs = {
      objectclass: %w(top inetOrgPerson organizationalPerson person),
      uid:  "delete-user1",
      cn:   "delete-user1",
      sn:   "delete-user1",
      mail: "delete-user1@rubyldap.com",
    }
    unless @ldap.search(base: @dn, scope: Net::LDAP::SearchScope_BaseObject)
      assert @ldap.add(dn: @dn, attributes: attrs), @ldap.get_operation_result.inspect
    end
    assert @ldap.search(base: @dn, scope: Net::LDAP::SearchScope_BaseObject)
  end

  def test_delete
    assert @ldap.delete(dn: @dn), @ldap.get_operation_result.inspect
    refute @ldap.search(base: @dn, scope: Net::LDAP::SearchScope_BaseObject)

    result = @ldap.get_operation_result
    assert_equal Net::LDAP::ResultCodeNoSuchObject, result.code
    assert_equal Net::LDAP::ResultStrings[Net::LDAP::ResultCodeNoSuchObject], result.message
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
net-ldap-0.16.1 test/integration/test_delete.rb
net-ldap-0.16.0 test/integration/test_delete.rb
net-ldap-0.15.0 test/integration/test_delete.rb
net-ldap-0.14.0 test/integration/test_delete.rb