diff options
author | Shinya Maeda <shinya@gitlab.com> | 2019-03-21 20:08:32 +0700 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2019-03-29 13:58:45 +0700 |
commit | bf639fd504c84929ff8542eef81578a6745bf428 (patch) | |
tree | b7eb20a2ef25de759ed3d8a2ef9a063c77564c03 /spec/factories/merge_requests.rb | |
parent | 3a477fec8f1fe6cf1da70a8ae0a8473ab26235bc (diff) | |
download | gitlab-ce-bf639fd504c84929ff8542eef81578a6745bf428.tar.gz |
Create detached merge request pipelinespersist-fulll-ref-path-for-mr-pipelines
By using `refs/merge-requests/:iid/head`
ok
ok
Improve naming nicely
Add nice tests
add nice tests
fix some more
revert
Diffstat (limited to 'spec/factories/merge_requests.rb')
-rw-r--r-- | spec/factories/merge_requests.rb | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/spec/factories/merge_requests.rb b/spec/factories/merge_requests.rb index a1809a26265..abf0e6bccb7 100644 --- a/spec/factories/merge_requests.rb +++ b/spec/factories/merge_requests.rb @@ -117,9 +117,20 @@ FactoryBot.define do end end + trait :with_legacy_detached_merge_request_pipeline do + after(:create) do |merge_request| + merge_request.merge_request_pipelines << create(:ci_pipeline, + source: :merge_request_event, + merge_request: merge_request, + project: merge_request.source_project, + ref: merge_request.source_branch, + sha: merge_request.source_branch_sha) + end + end + trait :with_detached_merge_request_pipeline do - after(:build) do |merge_request| - merge_request.merge_request_pipelines << build(:ci_pipeline, + after(:create) do |merge_request| + merge_request.merge_request_pipelines << create(:ci_pipeline, source: :merge_request_event, merge_request: merge_request, project: merge_request.source_project, @@ -135,7 +146,7 @@ FactoryBot.define do target_sha { target_branch_sha } end - after(:build) do |merge_request, evaluator| + after(:create) do |merge_request, evaluator| merge_request.merge_request_pipelines << create(:ci_pipeline, source: :merge_request_event, merge_request: merge_request, |