summaryrefslogtreecommitdiff
path: root/spec/uploaders
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/uploaders
parentfe62860e05ca6e3ef7125fe92fdf52cd6f7b63df (diff)
downloadgitlab-ce-f7c18ca31469b199c1a898cef583c9aae99f1375.tar.gz
Support uploads for groups
Diffstat (limited to 'spec/uploaders')
-rw-r--r--spec/uploaders/namespace_file_uploader_spec.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/uploaders/namespace_file_uploader_spec.rb b/spec/uploaders/namespace_file_uploader_spec.rb
new file mode 100644
index 00000000000..c6c4500c179
--- /dev/null
+++ b/spec/uploaders/namespace_file_uploader_spec.rb
@@ -0,0 +1,21 @@
+require 'spec_helper'
+
+describe NamespaceFileUploader do
+ let(:group) { build_stubbed(:group) }
+ let(:uploader) { described_class.new(group) }
+
+ describe "#store_dir" do
+ it "stores in the namespace id directory" do
+ expect(uploader.store_dir).to include(group.id.to_s)
+ end
+ end
+
+ describe ".absolute_path" do
+ it "stores in thecorrect directory" do
+ upload_record = create(:upload, :namespace_upload, model: group)
+
+ expect(described_class.absolute_path(upload_record))
+ .to include("-/system/namespace/#{group.id}")
+ end
+ end
+end