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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
724f986f
Commit
724f986f
authored
Jun 17, 2016
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Redirect to the member's source on request withdrawal
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
6c5b2377
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
3 deletions
+4
-3
app/controllers/concerns/membership_actions.rb
app/controllers/concerns/membership_actions.rb
+2
-1
spec/controllers/groups/group_members_controller_spec.rb
spec/controllers/groups/group_members_controller_spec.rb
+1
-1
spec/controllers/projects/project_members_controller_spec.rb
spec/controllers/projects/project_members_controller_spec.rb
+1
-1
No files found.
app/controllers/concerns/membership_actions.rb
View file @
724f986f
...
...
@@ -34,8 +34,9 @@ module MembershipActions
else
"You left the
\"
#{
@member
.
source
.
human_name
}
\"
#{
source_type
}
."
end
redirect_path
=
@member
.
request?
?
@member
.
source
:
[
:dashboard
,
@member
.
real_source_type
.
tableize
]
redirect_to
[
:dashboard
,
@member
.
real_source_type
.
tableize
]
,
notice:
notice
redirect_to
redirect_path
,
notice:
notice
else
if
cannot_leave?
alert
=
"You can not leave the
\"
#{
@member
.
source
.
human_name
}
\"
#{
source_type
}
."
...
...
spec/controllers/groups/group_members_controller_spec.rb
View file @
724f986f
...
...
@@ -134,7 +134,7 @@ describe Groups::GroupMembersController do
delete
:leave
,
group_id:
group
expect
(
response
).
to
set_flash
.
to
'Your access request to the group has been withdrawn.'
expect
(
response
).
to
redirect_to
(
dashboard_groups_path
)
expect
(
response
).
to
redirect_to
(
group_path
(
group
)
)
expect
(
group
.
members
.
request
).
to
be_empty
expect
(
group
.
users
).
not_to
include
user
end
...
...
spec/controllers/projects/project_members_controller_spec.rb
View file @
724f986f
...
...
@@ -190,7 +190,7 @@ describe Projects::ProjectMembersController do
project_id:
project
expect
(
response
).
to
set_flash
.
to
'Your access request to the project has been withdrawn.'
expect
(
response
).
to
redirect_to
(
dashboard_projects_path
)
expect
(
response
).
to
redirect_to
(
namespace_project_path
(
project
.
namespace
,
project
)
)
expect
(
project
.
members
.
request
).
to
be_empty
expect
(
project
.
users
).
not_to
include
user
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