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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
d89f4d73
Commit
d89f4d73
authored
Feb 15, 2017
by
Jarka Kadlecova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix error in MR widget after /merge slash command
parent
88132258
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
6 deletions
+13
-6
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+6
-3
changelogs/unreleased/28176_merge_widget_fix.yml
changelogs/unreleased/28176_merge_widget_fix.yml
+4
-0
spec/controllers/projects/merge_requests_controller_spec.rb
spec/controllers/projects/merge_requests_controller_spec.rb
+3
-3
No files found.
app/controllers/projects/merge_requests_controller.rb
View file @
d89f4d73
...
...
@@ -369,10 +369,13 @@ class Projects::MergeRequestsController < Projects::ApplicationController
end
def
merge_widget_refresh
if
merge_request
.
in_progress_merge_commit_sha
||
merge_request
.
state
==
'merged'
@status
=
:success
elsif
merge_request
.
merge_when_build_succeeds
if
merge_request
.
merge_when_build_succeeds
@status
=
:merge_when_build_succeeds
else
# Only MRs that can be merged end in this action
# MR can be already picked up for merge / merged already or can be waiting for worker to be picked up
# in last case it does not have any special status. Possible error is handled inside widget js function
@status
=
:success
end
render
'merge'
...
...
changelogs/unreleased/28176_merge_widget_fix.yml
0 → 100644
View file @
d89f4d73
---
title
:
Fix error in MR widget after /merge slash command
merge_request
:
9259
author
:
spec/controllers/projects/merge_requests_controller_spec.rb
View file @
d89f4d73
...
...
@@ -1143,15 +1143,15 @@ describe Projects::MergeRequestsController do
end
end
context
'when
no special status for MR
'
do
context
'when
MR does not have special state
'
do
let
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
)
}
it
'returns an OK response'
do
expect
(
response
).
to
have_http_status
(
:ok
)
end
it
'sets status to
nil
'
do
expect
(
assigns
(
:status
)).
to
be_nil
it
'sets status to
success
'
do
expect
(
assigns
(
:status
)).
to
eq
(
:success
)
expect
(
response
).
to
render_template
(
'merge'
)
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