2017-12-13 19:13:44 -05:00
|
|
|
FactoryBot.define do
|
2017-06-07 23:32:38 -04:00
|
|
|
factory :upload do
|
2017-08-02 15:55:11 -04:00
|
|
|
model { build(:project) }
|
2017-07-17 09:46:59 -04:00
|
|
|
path { "uploads/-/system/project/avatar/avatar.jpg" }
|
2017-06-07 23:32:38 -04:00
|
|
|
size 100.kilobytes
|
|
|
|
uploader "AvatarUploader"
|
2017-12-06 06:36:11 -05:00
|
|
|
|
|
|
|
trait :personal_snippet do
|
|
|
|
model { build(:personal_snippet) }
|
|
|
|
uploader "PersonalFileUploader"
|
|
|
|
end
|
|
|
|
|
|
|
|
trait :issuable_upload do
|
|
|
|
path { "#{SecureRandom.hex}/myfile.jpg" }
|
|
|
|
uploader "FileUploader"
|
|
|
|
end
|
|
|
|
|
|
|
|
trait :namespace_upload do
|
|
|
|
path { "#{SecureRandom.hex}/myfile.jpg" }
|
|
|
|
model { build(:group) }
|
|
|
|
uploader "NamespaceFileUploader"
|
|
|
|
end
|
2017-06-07 23:32:38 -04:00
|
|
|
end
|
|
|
|
end
|