Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2018-02-28 23:14:25 +0300
committerKamil Trzciński <ayufan@ayufan.eu>2018-02-28 23:14:25 +0300
commit79a5e7fb539dc6df7de590efb69fb9ab9d4614eb (patch)
tree951e2f3194c4b4d5488864791a9a94afe7122280 /spec/factories/uploads.rb
parent729391fbfce4dea58478b65c684a24a1bfd125a2 (diff)
parent7e424eb852716495073881710e8a8851b4a4cd5a (diff)
Merge commit '7e424eb852716495073881710e8a8851b4a4cd5a' into object-storage-ee-to-ce-backport
Diffstat (limited to 'spec/factories/uploads.rb')
-rw-r--r--spec/factories/uploads.rb20
1 files changed, 12 insertions, 8 deletions
diff --git a/spec/factories/uploads.rb b/spec/factories/uploads.rb
index 9e8a55eaedb..cd75cbf8adf 100644
--- a/spec/factories/uploads.rb
+++ b/spec/factories/uploads.rb
@@ -4,36 +4,40 @@ FactoryBot.define do
size 100.kilobytes
uploader "AvatarUploader"
store ObjectStorage::Store::LOCAL
+ mount_point :avatar
+ secret nil
# we should build a mount agnostic upload by default
transient do
- mounted_as :avatar
- secret SecureRandom.hex
+ filename 'myfile.jpg'
end
# this needs to comply with RecordsUpload::Concern#upload_path
- path { File.join("uploads/-/system", model.class.to_s.underscore, mounted_as.to_s, 'avatar.jpg') }
+ path { File.join("uploads/-/system", model.class.to_s.underscore, mount_point.to_s, 'avatar.jpg') }
trait :personal_snippet_upload do
- model { build(:personal_snippet) }
- path { File.join(secret, 'myfile.jpg') }
uploader "PersonalFileUploader"
+ path { File.join(secret, filename) }
+ model { build(:personal_snippet) }
+ secret SecureRandom.hex
end
trait :issuable_upload do
- path { File.join(secret, 'myfile.jpg') }
uploader "FileUploader"
+ path { File.join(secret, filename) }
+ secret SecureRandom.hex
end
trait :namespace_upload do
model { build(:group) }
- path { File.join(secret, 'myfile.jpg') }
+ path { File.join(secret, filename) }
uploader "NamespaceFileUploader"
+ secret SecureRandom.hex
end
trait :attachment_upload do
transient do
- mounted_as :attachment
+ mount_point :attachment
end
model { build(:note) }