Commit 2ad692ac authored by Clement Ho's avatar Clement Ho

Merge branch 'mr-widget-approval-regression' into 'master'

Only replace non-approval mr-widget-footer on getMergeStatus.

Closes #1866

See merge request !1393
parents ccafe1b0 f4ebe0e5
......@@ -149,7 +149,7 @@ require('./smart_interval');
var $html = $(data);
this.updateMergeButton(this.status, this.hasCi, $html);
$('.mr-widget-body').replaceWith($html.find('.mr-widget-body'));
$('.mr-widget-footer').replaceWith($html.find('.mr-widget-footer'));
$('.mr-widget-footer:not(.mr-approvals-footer)').replaceWith($html.find('.mr-widget-footer:not(.mr-approvals-footer)'));
$('.approvals-components').replaceWith($html.find('.approvals-components'));
if (gl.compileApprovalsWidget) {
......
---
title: Only replace non-approval mr-widget-footer on getMergeStatus.
merge_request:
author:
require 'spec_helper'
feature 'Merge Request closing issues message', feature: true do
include WaitForAjax
let(:user) { create(:user) }
let(:project) { create(:project, :public) }
let(:issue_1) { create(:issue, project: project)}
......@@ -78,4 +80,18 @@ feature 'Merge Request closing issues message', feature: true do
expect(page).to have_content("Accepting this merge request will close issue #{issue_1.to_reference}. Issue #{issue_2.to_reference} is mentioned but will not be closed.")
end
end
context 'approvals are enabled while closing issues', js: true do
before do
project.team << [user, :developer]
end
let(:project) { create(:project, :public, approvals_before_merge: 1) }
let(:merge_request_description) { "Description\n\nclosing #{issue_1.to_reference}, #{issue_2.to_reference}" }
it 'displays closing issue message exactly one time' do
wait_for_ajax
expect(page).to have_content("Accepting this merge request will close issues #{issue_1.to_reference} and #{issue_2.to_reference}", count: 1)
end
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