diff options
author | Felipe Artur <felipefac@gmail.com> | 2017-05-19 17:51:07 -0300 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2017-05-22 17:06:45 -0300 |
commit | 921c2be44af6a5a2af2b6e17945f0301c8158214 (patch) | |
tree | 1f2dc10b8661d6f6c95cd97433f1faf6d67b6852 /spec/models/merge_request_spec.rb | |
parent | 9d29eb7e292067fb980b4ca97fc6c3edac1dccec (diff) | |
download | gitlab-ce-921c2be44af6a5a2af2b6e17945f0301c8158214.tar.gz |
Add transient head_pipeline_of to pipeline factoriesissue_32225
Diffstat (limited to 'spec/models/merge_request_spec.rb')
-rw-r--r-- | spec/models/merge_request_spec.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/spec/models/merge_request_spec.rb b/spec/models/merge_request_spec.rb index ce870fcc1d3..0e05f719499 100644 --- a/spec/models/merge_request_spec.rb +++ b/spec/models/merge_request_spec.rb @@ -718,8 +718,7 @@ describe MergeRequest, models: true do describe '#head_pipeline' do describe 'when the source project exists' do it 'returns the latest pipeline' do - pipeline = create(:ci_empty_pipeline, project: subject.source_project, ref: 'master', status: 'running', sha: "123abc") - subject.update(head_pipeline: pipeline) + pipeline = create(:ci_empty_pipeline, project: subject.source_project, ref: 'master', status: 'running', sha: "123abc", head_pipeline_of: subject) expect(subject.head_pipeline).to eq(pipeline) end @@ -1396,9 +1395,8 @@ describe MergeRequest, models: true do project: project, ref: merge_request.source_branch, sha: merge_request.diff_head_sha, - status: status) - - merge_request.update(head_pipeline: pipeline) + status: status, + head_pipeline_of: merge_request) pipeline end |