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
Boxiang Sun
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
...
@@ -369,10 +369,13 @@ class Projects::MergeRequestsController < Projects::ApplicationController
end
end
def
merge_widget_refresh
def
merge_widget_refresh
if
merge_request
.
in_progress_merge_commit_sha
||
merge_request
.
state
==
'merged'
if
merge_request
.
merge_when_build_succeeds
@status
=
:success
elsif
merge_request
.
merge_when_build_succeeds
@status
=
: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
end
render
'merge'
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
...
@@ -1143,15 +1143,15 @@ describe Projects::MergeRequestsController do
end
end
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
)
}
let
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
)
}
it
'returns an OK response'
do
it
'returns an OK response'
do
expect
(
response
).
to
have_http_status
(
:ok
)
expect
(
response
).
to
have_http_status
(
:ok
)
end
end
it
'sets status to
nil
'
do
it
'sets status to
success
'
do
expect
(
assigns
(
:status
)).
to
be_nil
expect
(
assigns
(
:status
)).
to
eq
(
:success
)
expect
(
response
).
to
render_template
(
'merge'
)
expect
(
response
).
to
render_template
(
'merge'
)
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