diff options
author | Phil Hughes <me@iamphill.com> | 2017-01-22 12:37:05 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-01-22 12:37:05 +0000 |
commit | 91608be86d6d5a0a112eb753c0cfab9fae721e71 (patch) | |
tree | a61750cbc95591e394a720a4f3b812c9e1f00d95 | |
parent | 1b3b4f4e340210b12666230f34ede0d8dca1ae87 (diff) | |
download | gitlab-ce-91608be86d6d5a0a112eb753c0cfab9fae721e71.tar.gz |
Added spec testsmerge-dropdown-this-context
-rw-r--r-- | spec/features/merge_requests/merge_immediately_with_pipeline_spec.rb | 41 |
1 files changed, 41 insertions, 0 deletions
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 |