BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
2064a147
Unverified
Commit
2064a147
authored
Oct 20, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for remove group member feature in admin area
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
f50c0e5a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
3 deletions
+30
-3
group_members_controller.rb
app/controllers/groups/group_members_controller.rb
+1
-0
show.html.haml
app/views/admin/groups/show.html.haml
+1
-1
groups.feature
features/admin/groups.feature
+7
-0
groups.rb
features/steps/admin/groups.rb
+21
-2
No files found.
app/controllers/groups/group_members_controller.rb
View file @
2064a147
...
...
@@ -19,6 +19,7 @@ class Groups::GroupMembersController < ApplicationController
def
destroy
@users_group
=
@group
.
group_members
.
find
(
params
[
:id
])
if
can?
(
current_user
,
:destroy
,
@users_group
)
# May fail if last owner.
@users_group
.
destroy
respond_to
do
|
format
|
...
...
app/views/admin/groups/show.html.haml
View file @
2064a147
...
...
@@ -74,7 +74,7 @@
%ul
.well-list.group-users-list
-
@members
.
each
do
|
member
|
-
user
=
member
.
user
%li
{
class:
dom_class
(
user
)}
%li
{
class:
dom_class
(
member
),
id:
dom_id
(
user
)}
.list-item-name
%strong
=
link_to
user
.
name
,
admin_user_path
(
user
)
...
...
features/admin/groups.feature
View file @
2064a147
...
...
@@ -20,3 +20,10 @@ Feature: Admin Groups
When
I visit admin group page
When
I select user
"John Doe"
from user list as
"Reporter"
Then
I should see
"John Doe"
in team list in every project as
"Reporter"
@javascript
Scenario
:
Remove user from group
Given
we have user
"John Doe"
in group
When
I visit admin group page
And
I remove user
"John Doe"
from group
Then
I should not see
"John Doe"
in team list
features/steps/admin/groups.rb
View file @
2064a147
...
...
@@ -37,8 +37,7 @@ class Spinach::Features::AdminGroups < Spinach::FeatureSteps
end
When
'I select user "John Doe" from user list as "Reporter"'
do
user
=
User
.
find_by
(
name:
"John Doe"
)
select2
(
user
.
id
,
from:
"#user_ids"
,
multiple:
true
)
select2
(
user_john
.
id
,
from:
"#user_ids"
,
multiple:
true
)
within
"#new_team_member"
do
select
"Reporter"
,
from:
"access_level"
end
...
...
@@ -58,9 +57,29 @@ class Spinach::Features::AdminGroups < Spinach::FeatureSteps
end
end
step
'we have user "John Doe" in group'
do
current_group
.
add_user
(
user_john
,
Gitlab
::
Access
::
REPORTER
)
end
step
'I remove user "John Doe" from group'
do
within
"#user_
#{
user_john
.
id
}
"
do
click_link
'Remove user from group'
end
end
step
'I should not see "John Doe" in team list'
do
within
".group-users-list"
do
page
.
should_not
have_content
"John Doe"
end
end
protected
def
current_group
@group
||=
Group
.
first
end
def
user_john
@user_john
||=
User
.
find_by
(
name:
"John Doe"
)
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