diff options
author | Jarka Kadlecová <jarka@gitlab.com> | 2018-08-20 15:46:22 +0300 |
---|---|---|
committer | Jarka Kadlecová <jarka@gitlab.com> | 2018-08-21 14:59:41 +0300 |
commit | 0a1c805d851c8945baf540736024ebc5d385ce58 (patch) | |
tree | 889a6ec2b4eabce50ec23452b99370f25f954e0a /spec/uploaders | |
parent | 3c80adf5c8486315fa84ac237177c38b9ae625c9 (diff) |
Fix NamespaceUploader.base_dir for remote uploads
Diffstat (limited to 'spec/uploaders')
-rw-r--r-- | spec/uploaders/namespace_file_uploader_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/uploaders/namespace_file_uploader_spec.rb b/spec/uploaders/namespace_file_uploader_spec.rb index 71fe2c353c0..eafbea07e10 100644 --- a/spec/uploaders/namespace_file_uploader_spec.rb +++ b/spec/uploaders/namespace_file_uploader_spec.rb @@ -26,6 +26,20 @@ describe NamespaceFileUploader do upload_path: IDENTIFIER end + context '.base_dir' do + it 'returns local storage base_dir without store param' do + expect(described_class.base_dir(group)).to eq("uploads/-/system/namespace/#{group.id}") + end + + it 'returns local storage base_dir when store param is Store::LOCAL' do + expect(described_class.base_dir(group, ObjectStorage::Store::LOCAL)).to eq("uploads/-/system/namespace/#{group.id}") + end + + it 'returns remote base_dir when store param is Store::REMOTE' do + expect(described_class.base_dir(group, ObjectStorage::Store::REMOTE)).to eq("namespace/#{group.id}") + end + end + describe "#migrate!" do before do uploader.store!(fixture_file_upload(File.join('spec/fixtures/doc_sample.txt'))) |