summaryrefslogtreecommitdiff
path: root/spec/factories/uploads.rb
diff options
context:
space:
mode:
authorJarka Kadlecova <jarka@gitlab.com>2017-12-06 12:36:11 +0100
committerJarka Kadlecova <jarka@gitlab.com>2017-12-07 12:27:52 +0100
commitf7c18ca31469b199c1a898cef583c9aae99f1375 (patch)
tree72182129a81d996a886ea765514d20bc7e2bcf8c /spec/factories/uploads.rb
parentfe62860e05ca6e3ef7125fe92fdf52cd6f7b63df (diff)
downloadgitlab-ce-f7c18ca31469b199c1a898cef583c9aae99f1375.tar.gz
Support uploads for groups
Diffstat (limited to 'spec/factories/uploads.rb')
-rw-r--r--spec/factories/uploads.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/factories/uploads.rb b/spec/factories/uploads.rb
index 3222c41c3d8..e18f1a6bd4a 100644
--- a/spec/factories/uploads.rb
+++ b/spec/factories/uploads.rb
@@ -4,5 +4,21 @@ FactoryGirl.define do
path { "uploads/-/system/project/avatar/avatar.jpg" }
size 100.kilobytes
uploader "AvatarUploader"
+
+ 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
end
end