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
401cac62
Commit
401cac62
authored
Mar 28, 2014
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for LDAP::Adapter#dn_matches_filter?
parent
ec73107d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
+31
-0
spec/lib/gitlab/ldap/ldap_adapter_spec.rb
spec/lib/gitlab/ldap/ldap_adapter_spec.rb
+31
-0
No files found.
spec/lib/gitlab/ldap/ldap_adapter_spec.rb
0 → 100644
View file @
401cac62
require
'spec_helper'
describe
Gitlab
::
LDAP
::
Adapter
do
let
(
:adapter
)
{
Gitlab
::
LDAP
::
Adapter
.
new
}
describe
:dn_matches_filter?
do
let
(
:ldap
)
{
double
(
:ldap
)
}
subject
{
adapter
.
dn_matches_filter?
(
:dn
,
:filter
)
}
before
{
adapter
.
stub
(
ldap:
ldap
)
}
context
"when the search is successful"
do
context
"and the result is non-empty"
do
before
{
ldap
.
stub
(
search:
[
:foo
])
}
it
{
should
be_true
}
end
context
"and the result is empty"
do
before
{
ldap
.
stub
(
search:
[])
}
it
{
should
be_false
}
end
end
context
"when the search encounters an error"
do
before
{
ldap
.
stub
(
search:
nil
)
}
it
{
should
be_false
}
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