Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
bd6a9133
Commit
bd6a9133
authored
Sep 24, 2017
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix spec
parent
d2755c32
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
spec/ee/spec/lib/ee/gitlab/ldap/user_filter_spec.rb
spec/ee/spec/lib/ee/gitlab/ldap/user_filter_spec.rb
+9
-3
No files found.
spec/ee/spec/lib/ee/gitlab/ldap/user_filter_spec.rb
View file @
bd6a9133
...
...
@@ -7,6 +7,7 @@ describe EE::Gitlab::LDAP::UserFilter do
OmniAuth
::
AuthHash
.
new
(
uid:
'uid=john,ou=people,dc=example,dc=com'
,
provider:
'ldapmain'
)
end
let!
(
:fake_proxy
)
{
fake_ldap_sync_proxy
(
auth_hash
.
provider
)
}
let
(
:fake_entry
)
{
ldap_user_entry
(
'user1'
)
}
before
do
stub_ldap_config
(
...
...
@@ -19,10 +20,15 @@ describe EE::Gitlab::LDAP::UserFilter do
it
'returns dns from an LDAP search'
do
filter
=
'(ou=people)'
entry
=
ldap_group_entry
(
%w(john mary)
)
allow
(
fake_proxy
.
adapter
).
to
receive
(
:ldap_search
).
and_return
([
entry
])
allow
(
fake_proxy
.
adapter
).
to
receive
(
:ldap_search
).
and_return
([
fake_entry
])
expect
(
described_class
.
filter
(
fake_proxy
,
filter
)).
to
eq
(
''
)
expect
(
described_class
.
filter
(
fake_proxy
,
filter
)).
to
eq
([
'uid=user1,ou=users,dc=example,dc=com'
])
end
it
'errors out with an invalid filter'
do
filter
=
')('
expect
{
described_class
.
filter
(
fake_proxy
,
filter
)
}.
to
raise_error
(
Net
::
LDAP
::
FilterSyntaxInvalidError
,
'Invalid filter syntax.'
)
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment