Commit 4289c817 authored by Rémy Coutable's avatar Rémy Coutable

Extract EE-specific code from spec/factories/merge_requests.rb

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 06165c47
# frozen_string_literal: true
FactoryBot.modify do
factory :merge_request do
trait :with_approver do
after :create do |merge_request|
create :approver, target: merge_request
end
end
end
end
FactoryBot.define do
factory :merge_request_with_approver, parent: :merge_request, traits: [:with_approver]
factory :ee_merge_request, parent: :merge_request do
trait :with_license_management_reports do
after(:build) do |merge_request|
......
......@@ -68,12 +68,6 @@ FactoryBot.define do
target_branch "master"
end
trait :with_approver do
after :create do |merge_request|
create :approver, target: merge_request
end
end
trait :rebased do
source_branch "markdown"
target_branch "improve/awesome"
......@@ -141,7 +135,6 @@ FactoryBot.define do
factory :reopened_merge_request, traits: [:opened]
factory :invalid_merge_request, traits: [:invalid]
factory :merge_request_with_diffs, traits: [:with_diffs]
factory :merge_request_with_approver, traits: [:with_approver]
factory :merge_request_with_diff_notes do
after(:create) do |mr|
create(:diff_note_on_merge_request, noteable: mr, project: mr.source_project)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment