diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-07 18:09:14 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-07 18:09:14 +0300 |
commit | 9498dc957345829f29fe0bc4e55c969783b457be (patch) | |
tree | ca19b899f1eee13ad892fe18ece040347c3a1e71 /spec/factories | |
parent | ba27dbddc7dbc42f2cc8d84e815a9ea19f87a81d (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/factories')
-rw-r--r-- | spec/factories/merge_request_diffs.rb | 2 | ||||
-rw-r--r-- | spec/factories/merge_requests.rb | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/spec/factories/merge_request_diffs.rb b/spec/factories/merge_request_diffs.rb index f93f3f22109..d81f355737e 100644 --- a/spec/factories/merge_request_diffs.rb +++ b/spec/factories/merge_request_diffs.rb @@ -2,7 +2,7 @@ FactoryBot.define do factory :merge_request_diff do - association :merge_request, factory: :merge_request_without_merge_request_diff + association :merge_request, :skip_diff_creation state { :collected } commits_count { 1 } diff --git a/spec/factories/merge_requests.rb b/spec/factories/merge_requests.rb index 4941a31982f..390db24dde8 100644 --- a/spec/factories/merge_requests.rb +++ b/spec/factories/merge_requests.rb @@ -313,6 +313,12 @@ FactoryBot.define do sequence(:source_branch) { |n| "feature#{n}" } end + trait :skip_diff_creation do + before(:create) do |merge_request, _| + merge_request.skip_ensure_merge_request_diff = true + end + end + after(:build) do |merge_request| target_project = merge_request.target_project source_project = merge_request.source_project @@ -357,7 +363,5 @@ FactoryBot.define do merge_request.update!(labels: evaluator.labels) end end - - factory :merge_request_without_merge_request_diff, class: 'MergeRequestWithoutMergeRequestDiff' end end |