Commit 0630f672 authored by Jacob Schatz's avatar Jacob Schatz

Merge branch 'merge-dropdown-this-context' into 'master'

Fixed bug with merge immediately button not working

See merge request !8696
parents 125abfd4 91608be8
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
.off('click', '.js-merge-dropdown a') .off('click', '.js-merge-dropdown a')
.on('click', '.js-merge-dropdown a', (e) => { .on('click', '.js-merge-dropdown a', (e) => {
e.preventDefault(); e.preventDefault();
$(this).closest('form').submit(); $(e.target).closest('form').submit();
}); });
if ($('.rebase-in-progress').length) { if ($('.rebase-in-progress').length) {
merge_request_widget.rebaseInProgress(); merge_request_widget.rebaseInProgress();
......
---
title: Fixed bug where links in merge dropdown wouldn't work
merge_request:
author:
require 'spec_helper'
feature 'Merge immediately', :feature, :js do
let(:user) { create(:user) }
let(:project) { create(:project, :public) }
let(:merge_request) do
create(:merge_request_with_diffs, source_project: project,
author: user,
title: 'Bug NS-04')
end
let(:pipeline) do
create(:ci_pipeline, project: project,
sha: merge_request.diff_head_sha,
ref: merge_request.source_branch)
end
before { project.team << [user, :master] }
context 'when there is active pipeline for merge request' do
background do
create(:ci_build, pipeline: pipeline)
end
before do
login_as user
visit namespace_project_merge_request_path(merge_request.project.namespace, merge_request.project, merge_request)
end
it 'enables merge immediately' do
page.within '.mr-widget-body' do
find('.dropdown-toggle').click
click_link 'Merge Immediately'
expect(find('.js-merge-button')).to have_content('Merge in progress')
end
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