diff options
Diffstat (limited to 'spec/factories/merge_requests.rb')
-rw-r--r-- | spec/factories/merge_requests.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/factories/merge_requests.rb b/spec/factories/merge_requests.rb index b10c04a37f7..2a06690f894 100644 --- a/spec/factories/merge_requests.rb +++ b/spec/factories/merge_requests.rb @@ -109,6 +109,17 @@ FactoryBot.define do end end + trait :with_head_pipeline do + after(:build) do |merge_request| + merge_request.head_pipeline = build( + :ci_pipeline, + :running, + project: merge_request.source_project, + ref: merge_request.source_branch, + sha: merge_request.diff_head_sha) + end + end + trait :with_test_reports do after(:build) do |merge_request| merge_request.head_pipeline = build( @@ -133,6 +144,11 @@ FactoryBot.define do end end + trait :unique_branches do + source_branch { generate(:branch) } + target_branch { generate(:branch) } + end + trait :with_coverage_reports do after(:build) do |merge_request| merge_request.head_pipeline = build( |