diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-02 15:09:03 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-02 15:09:03 +0300 |
commit | c80b69a93fb4a6708b3337aa6e243ad09fe1d295 (patch) | |
tree | e3ad5a541f73d9457ae29fcf915c0fc6538cc149 /spec/factories | |
parent | 94823a9248837114ec84582f83b642ec45fe68ad (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/factories')
-rw-r--r-- | spec/factories/uploads.rb | 12 | ||||
-rw-r--r-- | spec/factories/wiki_pages.rb | 8 |
2 files changed, 10 insertions, 10 deletions
diff --git a/spec/factories/uploads.rb b/spec/factories/uploads.rb index b19af277cc3..85237e2d791 100644 --- a/spec/factories/uploads.rb +++ b/spec/factories/uploads.rb @@ -2,7 +2,7 @@ FactoryBot.define do factory :upload do - model { create(:project) } + model { association(:project) } size { 100.kilobytes } uploader { "AvatarUploader" } mount_point { :avatar } @@ -20,7 +20,7 @@ FactoryBot.define do end trait :personal_snippet_upload do - model { create(:personal_snippet) } + model { association(:personal_snippet) } path { File.join(secret, filename) } uploader { "PersonalFileUploader" } secret { SecureRandom.hex } @@ -46,7 +46,7 @@ FactoryBot.define do end trait :namespace_upload do - model { create(:group) } + model { association(:group) } path { File.join(secret, filename) } uploader { "NamespaceFileUploader" } secret { SecureRandom.hex } @@ -54,7 +54,7 @@ FactoryBot.define do end trait :favicon_upload do - model { create(:appearance) } + model { association(:appearance) } uploader { "FaviconUploader" } secret { SecureRandom.hex } mount_point { :favicon } @@ -62,13 +62,13 @@ FactoryBot.define do trait :attachment_upload do mount_point { :attachment } - model { create(:note) } + model { association(:note) } uploader { "AttachmentUploader" } end trait :design_action_image_v432x230_upload do mount_point { :image_v432x230 } - model { create(:design_action) } + model { association(:design_action) } uploader { ::DesignManagement::DesignV432x230Uploader.name } end end diff --git a/spec/factories/wiki_pages.rb b/spec/factories/wiki_pages.rb index 3397277839e..6f912a183e8 100644 --- a/spec/factories/wiki_pages.rb +++ b/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 } |