diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2018-09-07 12:24:21 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2018-09-07 12:24:21 +0300 |
commit | 3276e88bd5d372004a599d4e3cbb3dda6b32a777 (patch) | |
tree | 902532d7c8b675c3871ab6918cc26621eadae551 /spec/uploaders | |
parent | 2cffa02e395135aa6d0c1dfa98dec1d0bd1b6fe7 (diff) | |
parent | 0a1c805d851c8945baf540736024ebc5d385ce58 (diff) |
Merge branch 'fix-namespace-uploader' into 'master'
Fix NamespaceUploader.base_dir for remote uploads
See merge request gitlab-org/gitlab-ce!21308
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'))) |