diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-20 06:06:16 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-20 06:06:16 +0000 |
commit | 0282449e6ea95b54b32acfd2de24c8c5f64a8165 (patch) | |
tree | 017b43b103e45ff571d637a5efc77b5ed25c0686 /spec/models/ci/pipeline_spec.rb | |
parent | 0ecdcf59f4342de55a7d2c3ee4ac0d9c3b116aa5 (diff) | |
download | gitlab-ce-0282449e6ea95b54b32acfd2de24c8c5f64a8165.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/ci/pipeline_spec.rb')
-rw-r--r-- | spec/models/ci/pipeline_spec.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/spec/models/ci/pipeline_spec.rb b/spec/models/ci/pipeline_spec.rb index 6d8d3799d57..e4c22bfb2e8 100644 --- a/spec/models/ci/pipeline_spec.rb +++ b/spec/models/ci/pipeline_spec.rb @@ -2474,7 +2474,9 @@ describe Ci::Pipeline, :mailer do let(:pipeline) { create(:ci_empty_pipeline, status: 'created', project: project, ref: 'master', sha: 'a288a022a53a5a944fae87bcec6efc87b7061808') } it "returns merge requests whose `diff_head_sha` matches the pipeline's SHA" do - allow_any_instance_of(MergeRequest).to receive(:diff_head_sha) { 'a288a022a53a5a944fae87bcec6efc87b7061808' } + allow_next_instance_of(MergeRequest) do |instance| + allow(instance).to receive(:diff_head_sha) { 'a288a022a53a5a944fae87bcec6efc87b7061808' } + end merge_request = create(:merge_request, source_project: project, head_pipeline: pipeline, source_branch: pipeline.ref) expect(pipeline.merge_requests_as_head_pipeline).to eq([merge_request]) @@ -2488,7 +2490,9 @@ describe Ci::Pipeline, :mailer do it "doesn't return merge requests whose `diff_head_sha` doesn't match the pipeline's SHA" do create(:merge_request, source_project: project, source_branch: pipeline.ref) - allow_any_instance_of(MergeRequest).to receive(:diff_head_sha) { '97de212e80737a608d939f648d959671fb0a0142b' } + allow_next_instance_of(MergeRequest) do |instance| + allow(instance).to receive(:diff_head_sha) { '97de212e80737a608d939f648d959671fb0a0142b' } + end expect(pipeline.merge_requests_as_head_pipeline).to be_empty end |