summaryrefslogtreecommitdiff
path: root/spec/features
diff options
context:
space:
mode:
authorEric Eastwood <contact@ericeastwood.com>2017-10-02 11:11:18 -0500
committerEric Eastwood <contact@ericeastwood.com>2017-10-05 01:46:16 -0500
commit6a5b2fe8943190cff40e6e2c5dbc629fa4540151 (patch)
tree220edd683a2837209e64cfc38c8c2f1d5225f2d4 /spec/features
parent8921af39e74976e37e92c786bd957883110f6522 (diff)
downloadgitlab-ce-6a5b2fe8943190cff40e6e2c5dbc629fa4540151.tar.gz
Allow merge when no pipeline success38389-allow-merge-without-success
Fix https://gitlab.com/gitlab-org/gitlab-ce/issues/38389
Diffstat (limited to 'spec/features')
-rw-r--r--spec/features/merge_requests/widget_spec.rb19
1 files changed, 18 insertions, 1 deletions
diff --git a/spec/features/merge_requests/widget_spec.rb b/spec/features/merge_requests/widget_spec.rb
index 791cfa308c3..ab1353e3369 100644
--- a/spec/features/merge_requests/widget_spec.rb
+++ b/spec/features/merge_requests/widget_spec.rb
@@ -3,10 +3,13 @@ require 'rails_helper'
describe 'Merge request', :js do
let(:user) { create(:user) }
let(:project) { create(:project, :repository) }
+ let(:project_only_mwps) { create(:project, :repository, only_allow_merge_if_pipeline_succeeds: true) }
let(:merge_request) { create(:merge_request, source_project: project) }
+ let(:merge_request_in_only_mwps_project) { create(:merge_request, source_project: project_only_mwps) }
before do
- project.team << [user, :master]
+ project.add_master(user)
+ project_only_mwps.add_master(user)
sign_in(user)
end
@@ -160,6 +163,20 @@ describe 'Merge request', :js do
end
end
+ context 'view merge request in project with only-mwps setting enabled but no CI is setup' do
+ before do
+ visit project_merge_request_path(project_only_mwps, merge_request_in_only_mwps_project)
+ end
+
+ it 'should be allowed to merge' do
+ # Wait for the `ci_status` and `merge_check` requests
+ wait_for_requests
+
+ expect(page).to have_selector('.accept-merge-request')
+ expect(find('.accept-merge-request')['disabled']).not_to be(true)
+ end
+ end
+
context 'view merge request with MWPS enabled but automatically merge fails' do
before do
merge_request.update(