forked from hackorum-dev/hackorum
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommitfest_patches.rb
More file actions
27 lines (24 loc) · 809 Bytes
/
commitfest_patches.rb
File metadata and controls
27 lines (24 loc) · 809 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
FactoryBot.define do
factory :commitfest_patch do
sequence(:external_id)
sequence(:title) { |n| "Patch Title ##{n}" }
trait :with_topic do
transient { topic { create(:topic) } }
after(:create) do |cp, ctx|
create(:commitfest_patch_topic, commitfest_patch: cp, topic: ctx.topic)
end
end
trait :with_commitfest do
transient { commitfest { create(:commitfest) } }
after(:create) do |cp, ctx|
create(:commitfest_patch_commitfest, commitfest_patch: cp, commitfest: ctx.commitfest)
end
end
trait :with_tag do
transient { commitfest_tag { create(:commitfest_tag) } }
after(:create) do |cp, ctx|
create(:commitfest_patch_tag, commitfest_patch: cp, commitfest_tag: ctx.commitfest_tag)
end
end
end
end