diff options
Diffstat (limited to 'spec/factories/events.rb')
-rw-r--r-- | spec/factories/events.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/spec/factories/events.rb b/spec/factories/events.rb index 6c9f1ba0137..c9e4ada3ffa 100644 --- a/spec/factories/events.rb +++ b/spec/factories/events.rb @@ -27,17 +27,20 @@ FactoryBot.define do factory :wiki_page_event do action { :created } + # rubocop: disable FactoryBot/InlineAssociation + # A persistent project is needed to have a wiki page being created properly. project { @overrides[:wiki_page]&.container || create(:project, :wiki_repo) } - target { create(:wiki_page_meta, :for_wiki_page, wiki_page: wiki_page) } + # rubocop: enable FactoryBot/InlineAssociation + target { association(:wiki_page_meta, :for_wiki_page, wiki_page: wiki_page) } transient do - wiki_page { create(:wiki_page, container: project) } + wiki_page { association(:wiki_page, container: project) } end end trait :has_design do transient do - design { create(:design, issue: create(:issue, project: project)) } + design { association(:design, issue: association(:issue, project: project)) } end end @@ -45,7 +48,7 @@ FactoryBot.define do has_design transient do - note { create(:note, author: author, project: project, noteable: design) } + note { association(:note, author: author, project: project, noteable: design) } end action { :commented } |