diff options
author | Douwe Maan <douwe@selenight.nl> | 2018-12-28 12:18:50 +0100 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2019-01-02 15:31:34 +0100 |
commit | 7388a911aa61ad3a9fb061517e22e74427155b5e (patch) | |
tree | 55d9f68838962b99a970925bead07a612fc5a863 /spec | |
parent | 8c2172f215f83893516c0f3cfad8a5daa7320a50 (diff) | |
download | gitlab-ce-7388a911aa61ad3a9fb061517e22e74427155b5e.tar.gz |
Consider all matching MRs to determine if user can push
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/project_spec.rb | 10 | ||||
-rw-r--r-- | spec/services/ci/retry_pipeline_service_spec.rb | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 131de62fe03..f195f7ce48e 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -3831,6 +3831,16 @@ describe Project do let(:user) { create(:user) } let(:target_project) { create(:project, :repository) } let(:project) { fork_project(target_project, nil, repository: true) } + let!(:local_merge_request) do + create( + :merge_request, + target_project: project, + target_branch: 'target-branch', + source_project: project, + source_branch: 'awesome-feature-1', + allow_collaboration: true + ) + end let!(:merge_request) do create( :merge_request, diff --git a/spec/services/ci/retry_pipeline_service_spec.rb b/spec/services/ci/retry_pipeline_service_spec.rb index 55445e71539..75042b29bea 100644 --- a/spec/services/ci/retry_pipeline_service_spec.rb +++ b/spec/services/ci/retry_pipeline_service_spec.rb @@ -285,7 +285,7 @@ describe Ci::RetryPipelineService, '#execute' do end it 'allows to retry failed pipeline' do - allow_any_instance_of(Project).to receive(:fetch_branch_allows_collaboration?).and_return(true) + allow_any_instance_of(Project).to receive(:branch_allows_collaboration?).and_return(true) allow_any_instance_of(Project).to receive(:empty_repo?).and_return(false) service.execute(pipeline) |