Commit d89f4d73 authored by Jarka Kadlecova's avatar Jarka Kadlecova

Fix error in MR widget after /merge slash command

parent 88132258
......@@ -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'
......
---
title: Fix error in MR widget after /merge slash command
merge_request: 9259
author:
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment