Skip to content

Commit 12ea8ad

Browse files
committed
Test disabled posixGroup support
1 parent 64688cf commit 12ea8ad

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

test/domain_test.rb

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,21 +213,25 @@ def test_membership_for_posixGroups
213213
class GitHubLdapWithoutPosixGroupsTest < GitHub::Ldap::Test
214214
def self.test_server_options
215215
{
216+
custom_schemas: FIXTURES.join('posixGroup.schema.ldif'),
217+
user_fixtures: FIXTURES.join('github-with-posixGroups.ldif').to_s,
216218
# so we test the test the non-recursive group membership search
217-
recursive_group_search_fallback: false
219+
recursive_group_search_fallback: false,
220+
# explicitly disable posixGroup support (even if the schema supports it)
221+
posix_support: false
218222
}
219223
end
220224

221225
def setup
222226
@ldap = GitHub::Ldap.new(options)
223227
@domain = @ldap.domain("dc=github,dc=com")
224-
@cn = "Enterprise"
228+
@cn = "enterprise-posix-devs"
225229
end
226230

227231
def test_membership_for_posixGroups
228-
assert user = @ldap.domain('uid=calavera,dc=github,dc=com').bind
232+
assert user = @ldap.domain('uid=mtodd,ou=users,dc=github,dc=com').bind
229233

230-
assert @domain.is_member?(user, [@cn]),
231-
"Expected `#{@cn}` to include the member `#{user.dn}`"
234+
refute @domain.is_member?(user, [@cn]),
235+
"Expected `#{@cn}` to not include the member `#{user.dn}`"
232236
end
233237
end

0 commit comments

Comments
 (0)