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
657bc805
Unverified
Commit
657bc805
authored
Jun 06, 2017
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add json support to group members leave action in controller
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
323a326c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
membership_actions.rb
app/controllers/concerns/membership_actions.rb
+7
-2
group_members_controller_spec.rb
spec/controllers/groups/group_members_controller_spec.rb
+7
-0
No files found.
app/controllers/concerns/membership_actions.rb
View file @
657bc805
...
...
@@ -51,9 +51,14 @@ module MembershipActions
"You left the
\"
#{
membershipable
.
human_name
}
\"
#{
source_type
}
."
end
redirect_path
=
member
.
request?
?
member
.
source
:
[
:dashboard
,
membershipable
.
class
.
to_s
.
tableize
]
respond_to
do
|
format
|
format
.
html
do
redirect_path
=
member
.
request?
?
member
.
source
:
[
:dashboard
,
membershipable
.
class
.
to_s
.
tableize
]
redirect_to
redirect_path
,
notice:
notice
end
redirect_to
redirect_path
,
notice:
notice
format
.
json
{
head
:ok
}
end
end
protected
...
...
spec/controllers/groups/group_members_controller_spec.rb
View file @
657bc805
...
...
@@ -124,6 +124,13 @@ describe Groups::GroupMembersController do
expect
(
response
).
to
redirect_to
(
dashboard_groups_path
)
expect
(
group
.
users
).
not_to
include
user
end
it
'supports json request'
do
delete
:leave
,
group_id:
group
,
format: :json
expect
(
response
).
to
have_http_status
(
200
)
expect
(
response
.
body
).
to
be_empty
end
end
context
'and is an owner'
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