diff options
author | Jacob Schatz <jschatz@gitlab.com> | 2017-01-22 14:19:58 +0000 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2017-01-24 16:46:45 +0100 |
commit | 94cc685f70dd7790a40d58fb654cb4a8c17f7eea (patch) | |
tree | d76bedd8a11443cecbe29f973fb3015908fb3a1b | |
parent | b697b78308923f9bef07af6cb4bba9a3709b750c (diff) | |
download | gitlab-ce-94cc685f70dd7790a40d58fb654cb4a8c17f7eea.tar.gz |
Merge branch 'merge-dropdown-this-context' into 'master'
Fixed bug with merge immediately button not working
See merge request !8696
3 files changed, 46 insertions, 1 deletions
diff --git a/app/assets/javascripts/merge_request_widget/ci_bundle.js.es6 b/app/assets/javascripts/merge_request_widget/ci_bundle.js.es6 index 9c4a7eabcb6..5969d2ba56b 100644 --- a/app/assets/javascripts/merge_request_widget/ci_bundle.js.es6 +++ b/app/assets/javascripts/merge_request_widget/ci_bundle.js.es6 @@ -30,7 +30,7 @@ .off('click', '.js-merge-dropdown a') .on('click', '.js-merge-dropdown a', (e) => { e.preventDefault(); - $(this).closest('form').submit(); + $(e.target).closest('form').submit(); }); if ($('.rebase-in-progress').length) { merge_request_widget.rebaseInProgress(); diff --git a/changelogs/unreleased/merge-dropdown-this-context.yml b/changelogs/unreleased/merge-dropdown-this-context.yml new file mode 100644 index 00000000000..5c4890fcaa2 --- /dev/null +++ b/changelogs/unreleased/merge-dropdown-this-context.yml @@ -0,0 +1,4 @@ +--- +title: Fixed bug where links in merge dropdown wouldn't work +merge_request: +author: diff --git a/spec/features/merge_requests/merge_immediately_with_pipeline_spec.rb b/spec/features/merge_requests/merge_immediately_with_pipeline_spec.rb new file mode 100644 index 00000000000..f2f8f11ab28 --- /dev/null +++ b/spec/features/merge_requests/merge_immediately_with_pipeline_spec.rb @@ -0,0 +1,41 @@ +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 |