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
3bccf2fd
Commit
3bccf2fd
authored
Aug 18, 2017
by
Michael Kozono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor with LDAP spec helpers
parent
a27b4f74
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
spec/lib/gitlab/ldap/user_spec.rb
spec/lib/gitlab/ldap/user_spec.rb
+5
-4
No files found.
spec/lib/gitlab/ldap/user_spec.rb
View file @
3bccf2fd
require
'spec_helper'
describe
Gitlab
::
LDAP
::
User
do
include
LdapHelpers
let
(
:ldap_user
)
{
described_class
.
new
(
auth_hash
)
}
let
(
:gl_user
)
{
ldap_user
.
gl_user
}
let
(
:info
)
do
...
...
@@ -174,8 +176,7 @@ describe Gitlab::LDAP::User do
describe
'blocking'
do
def
configure_block
(
value
)
allow_any_instance_of
(
Gitlab
::
LDAP
::
Config
)
.
to
receive
(
:block_auto_created_users
).
and_return
(
value
)
stub_ldap_config
(
block_auto_created_users:
value
)
end
context
'signup'
do
...
...
@@ -268,7 +269,7 @@ describe Gitlab::LDAP::User do
describe
'#in_any_external_group?'
do
context
'when there is an external group'
do
before
do
expect_any_instance_of
(
Gitlab
::
LDAP
::
Config
).
to
receive
(
:external_groups
).
and_return
(
[
'foo'
])
stub_ldap_config
(
external_groups:
[
'foo'
])
end
context
'when the user is in an external group'
do
...
...
@@ -294,7 +295,7 @@ describe Gitlab::LDAP::User do
context
'when are no external groups'
do
before
do
expect_any_instance_of
(
Gitlab
::
LDAP
::
Config
).
to
receive
(
:external_groups
).
and_return
(
[])
stub_ldap_config
(
external_groups:
[])
end
it
'returns false'
do
...
...
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