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
988c6d88
Commit
988c6d88
authored
Dec 07, 2016
by
Douglas Barbosa Alexandre
Committed by
Phil Hughes
Dec 12, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test to access levels changes of users when LDAP group sync is true
parent
7b372007
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
0 deletions
+70
-0
spec/features/groups/members/override_ldap_memberships_spec.rb
...features/groups/members/override_ldap_memberships_spec.rb
+70
-0
No files found.
spec/features/groups/members/override_ldap_memberships_spec.rb
0 → 100644
View file @
988c6d88
require
'spec_helper'
feature
'Groups > Members > Master/Owner can override LDAP access levels'
,
feature:
true
do
include
WaitForAjax
let
(
:johndoe
)
{
create
(
:user
,
name:
'John Doe'
)
}
let
(
:maryjane
)
{
create
(
:user
,
name:
'Mary Jane'
)
}
let
(
:owner
)
{
create
(
:user
)
}
let
(
:group
)
{
create
(
:group_with_ldap_group_link
,
:public
)
}
let!
(
:owner_member
)
{
create
(
:group_member
,
:owner
,
group:
group
,
user:
owner
)
}
let!
(
:ldap_member
)
{
create
(
:group_member
,
:guest
,
group:
group
,
user:
johndoe
,
ldap:
true
)
}
let!
(
:regular_member
)
{
create
(
:group_member
,
:guest
,
group:
group
,
user:
maryjane
,
ldap:
false
)
}
background
do
# We need to actually activate the LDAP config otherwise `Group#ldap_synced?` # will always be false!
allow
(
Gitlab
.
config
.
ldap
).
to
receive_messages
(
enabled:
true
)
login_as
(
owner
)
end
scenario
'owner can override LDAP access level'
,
js:
true
do
ldap_override_message
=
'John Doe is currently an LDAP user. Editing their permissions will override the settings from the LDAP group sync.'
visit
group_group_members_path
(
group
)
within
"#group_member_
#{
ldap_member
.
id
}
"
do
expect
(
page
).
to
have_content
'LDAP'
expect
(
page
).
to
have_button
'Guest'
,
disabled:
true
expect
(
page
).
to
have_button
'Edit permissions'
click_button
'Edit permissions'
end
expect
(
page
).
to
have_content
ldap_override_message
click_button
'Change permissions'
expect
(
page
).
not_to
have_content
ldap_override_message
expect
(
page
).
not_to
have_button
'Change permissions'
within
"#group_member_
#{
ldap_member
.
id
}
"
do
expect
(
page
).
not_to
have_button
'Edit permissions'
expect
(
page
).
to
have_button
'Guest'
,
disabled:
false
click_button
'Guest'
within
'.dropdown-menu'
do
click_link
'Revert to LDAP group sync settings'
end
wait_for_ajax
expect
(
page
).
to
have_button
'Guest'
,
disabled:
true
expect
(
page
).
to
have_button
'Edit permissions'
end
within
"#group_member_
#{
regular_member
.
id
}
"
do
expect
(
page
).
not_to
have_content
'LDAP'
expect
(
page
).
not_to
have_button
'Edit permissions'
expect
(
page
).
to
have_button
'Guest'
,
disabled:
false
click_button
'Guest'
within
'.dropdown-menu'
do
expect
(
page
).
not_to
have_content
'Revert to LDAP group sync settings'
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