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
0
Merge Requests
0
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
Kazuhiko Shiozaki
gitlab-ce
Commits
d54133b0
Commit
d54133b0
authored
May 14, 2014
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add spec for LDAP::Access#allowed?
parent
982d4d51
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
spec/lib/gitlab/ldap/ldap_access_spec.rb
spec/lib/gitlab/ldap/ldap_access_spec.rb
+32
-0
No files found.
spec/lib/gitlab/ldap/ldap_access_spec.rb
0 → 100644
View file @
d54133b0
require
'spec_helper'
describe
Gitlab
::
LDAP
::
Access
do
let
(
:access
)
{
Gitlab
::
LDAP
::
Access
.
new
}
let
(
:user
)
{
create
(
:user
)
}
describe
:allowed?
do
subject
{
access
.
allowed?
(
user
)
}
context
'when the user cannot be found'
do
before
{
Gitlab
::
LDAP
::
Person
.
stub
(
find_by_dn:
nil
)
}
it
{
should
be_false
}
end
context
'when the user is found'
do
before
{
Gitlab
::
LDAP
::
Person
.
stub
(
find_by_dn: :ldap_user
)
}
context
'and the Active Directory disabled flag is set'
do
before
{
Gitlab
::
LDAP
::
Person
.
stub
(
ad_disabled?:
true
)
}
it
{
should
be_false
}
end
context
'and the Active Directory disabled flag is not set'
do
before
{
Gitlab
::
LDAP
::
Person
.
stub
(
ad_disabled?:
false
)
}
it
{
should
be_true
}
end
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