diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-15 12:09:46 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-15 12:09:46 +0300 |
commit | 221b529789f4090341a825695aeb49b8df6dd11d (patch) | |
tree | c8843e4ca5ef1034752eb68712fcf338b24950db /spec/uploaders/object_storage_spec.rb | |
parent | 00a8c64ffd18e74df4b1cdeda7776b5221fddafe (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/uploaders/object_storage_spec.rb')
-rw-r--r-- | spec/uploaders/object_storage_spec.rb | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/spec/uploaders/object_storage_spec.rb b/spec/uploaders/object_storage_spec.rb index e844b0ad799..f42d581ece4 100644 --- a/spec/uploaders/object_storage_spec.rb +++ b/spec/uploaders/object_storage_spec.rb @@ -597,22 +597,6 @@ describe ObjectStorage do end context 'when local file is used' do - context 'when valid file is used' do - let(:uploaded_file) do - fixture_file_upload('spec/fixtures/rails_sample.jpg', 'image/jpg') - end - - it "properly caches the file" do - subject - - expect(uploader).to be_exists - expect(uploader.path).to start_with(uploader_class.root) - expect(uploader.filename).to eq('rails_sample.jpg') - end - end - end - - context 'when local file is used' do let(:temp_file) { Tempfile.new("test") } before do @@ -627,6 +611,14 @@ describe ObjectStorage do context 'when valid file is specified' do let(:uploaded_file) { temp_file } + it 'properly caches the file' do + subject + + expect(uploader).to be_exists + expect(uploader.path).to start_with(uploader_class.root) + expect(uploader.filename).to eq(File.basename(uploaded_file.path)) + end + context 'when object storage and direct upload is specified' do before do stub_uploads_object_storage(uploader_class, enabled: true, direct_upload: true) |