Commit 75223963 authored by a_luna's avatar a_luna

Fix cop FactoryBot/InlineAssociation for wiki pages

parent 13e00158
......@@ -1282,4 +1282,3 @@ FactoryBot/InlineAssociation:
- 'spec/factories/packages/package_file.rb'
- 'spec/factories/sent_notifications.rb'
- 'spec/factories/uploads.rb'
- 'spec/factories/wiki_pages.rb'
......@@ -39,14 +39,14 @@ FactoryBot.define do
factory :wiki_page_meta, class: 'WikiPage::Meta' do
title { generate(:wiki_page_title) }
project { create(:project) }
project { association(:project) }
trait :for_wiki_page do
transient do
wiki_page { create(:wiki_page, container: project) }
wiki_page { association(:wiki_page, container: project) }
end
project { @overrides[:wiki_page]&.container || create(:project) }
project { @overrides[:wiki_page]&.container || association(:project) }
title { wiki_page.title }
initialize_with do
......@@ -58,7 +58,7 @@ FactoryBot.define do
end
factory :wiki_page_slug, class: 'WikiPage::Slug' do
wiki_page_meta { create(:wiki_page_meta) }
wiki_page_meta { association(:wiki_page_meta) }
slug { generate(:sluggified_title) }
canonical { false }
......
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