Commit bacaf50c authored by Kamil Trzciński's avatar Kamil Trzciński

Merge branch '209967-object-storage-spec-tidy' into 'master'

Combine ObjectStorage spec contexts

See merge request gitlab-org/gitlab!29540
parents 1d050f90 a57993ff
...@@ -596,22 +596,6 @@ describe ObjectStorage do ...@@ -596,22 +596,6 @@ describe ObjectStorage do
uploader.cache!(uploaded_file) uploader.cache!(uploaded_file)
end 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 context 'when local file is used' do
let(:temp_file) { Tempfile.new("test") } let(:temp_file) { Tempfile.new("test") }
...@@ -627,6 +611,14 @@ describe ObjectStorage do ...@@ -627,6 +611,14 @@ describe ObjectStorage do
context 'when valid file is specified' do context 'when valid file is specified' do
let(:uploaded_file) { temp_file } 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 context 'when object storage and direct upload is specified' do
before do before do
stub_uploads_object_storage(uploader_class, enabled: true, direct_upload: true) stub_uploads_object_storage(uploader_class, enabled: true, direct_upload: true)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment