diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-18 13:16:36 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-18 13:16:36 +0000 |
commit | 311b0269b4eb9839fa63f80c8d7a58f32b8138a0 (patch) | |
tree | 07e7870bca8aed6d61fdcc810731c50d2c40af47 /spec/factories/project_members.rb | |
parent | 27909cef6c4170ed9205afa7426b8d3de47cbb0c (diff) | |
download | gitlab-ce-14.5.0-rc42.tar.gz |
Add latest changes from gitlab-org/gitlab@14-5-stable-eev14.5.0-rc42
Diffstat (limited to 'spec/factories/project_members.rb')
-rw-r--r-- | spec/factories/project_members.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/factories/project_members.rb b/spec/factories/project_members.rb index 3e83ab7118c..f2dedc178c7 100644 --- a/spec/factories/project_members.rb +++ b/spec/factories/project_members.rb @@ -23,5 +23,15 @@ FactoryBot.define do trait :blocked do after(:build) { |project_member, _| project_member.user.block! } end + + transient do + tasks_to_be_done { [] } + end + + after(:build) do |project_member, evaluator| + if evaluator.tasks_to_be_done.present? + build(:member_task, member: project_member, project: project_member.source, tasks_to_be_done: evaluator.tasks_to_be_done) + end + end end end |