Skip to content
This repository was archived by the owner on Oct 27, 2022. It is now read-only.

Commit fd412c2

Browse files
committed
test_entry should not be rejected if username is missing, but it should not set the uid
to create situation where the entry exists but does not have a uid.
1 parent fd8bc2d commit fd412c2

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

spec/support/ldap_shared_examples.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
shared_context 'mocked ldap' do |returns:|
22
let(:entry_users) { send(returns) }
33
let(:expected_entries) {
4-
entry_users.reject{ |u|
5-
!u.has_key? :username
6-
}.map { |test_user|
4+
entry_users.map { |test_user|
75
expected_entry = Net::LDAP::Entry.new
8-
expected_entry[:uid] = test_user[:username]
6+
expected_entry[:uid] = test_user[:username] if test_user[:username]
97
expected_entry[:givenName] = test_user[:first_name]
108
expected_entry[:sn] = test_user[:last_name]
119
expected_entry[:mail] = test_user[:email] if test_user[:email]

0 commit comments

Comments
 (0)