diff options
author | James Lopez <james@jameslopez.es> | 2018-07-13 16:13:13 +0200 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2018-07-13 16:13:13 +0200 |
commit | 07ec2c7bd00e6d0487e3f81864af982ec73365b2 (patch) | |
tree | 97395261df8101c2f3455786ff8dcf3fbb482295 /spec/uploaders | |
parent | 1263367c3fda134db41e115965c5134933dcb7c7 (diff) | |
download | gitlab-ce-07ec2c7bd00e6d0487e3f81864af982ec73365b2.tar.gz |
use fileuploader dynamic path method in uploads manager and add spec48745-project-exports-fail-when-uploads-have-been-migrated-to-object-storage
Diffstat (limited to 'spec/uploaders')
-rw-r--r-- | spec/uploaders/file_uploader_spec.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/uploaders/file_uploader_spec.rb b/spec/uploaders/file_uploader_spec.rb index 7ba28b4fc1f..3efe512a59c 100644 --- a/spec/uploaders/file_uploader_spec.rb +++ b/spec/uploaders/file_uploader_spec.rb @@ -124,6 +124,15 @@ describe FileUploader do end end + describe '.extract_dynamic_path' do + it 'works with hashed storage' do + path = 'export/4b227777d4dd1fc61c6f884f48641d02b4d121d3fd328cb08b5531fcacdabf8a/test/uploads/72a497a02fe3ee09edae2ed06d390038/dummy.txt' + + expect(described_class.extract_dynamic_path(path)[:identifier]).to eq('dummy.txt') + expect(described_class.extract_dynamic_path(path)[:secret]).to eq('72a497a02fe3ee09edae2ed06d390038') + end + end + describe '#secret' do it 'generates a secret if none is provided' do expect(described_class).to receive(:generate_secret).and_return('secret') |