diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-31 11:12:00 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-31 11:12:00 +0300 |
commit | 45178c069b1e5e4bf8716296ad794202a14fd167 (patch) | |
tree | f84afbdf062d35a4d1ec558ff1e3d755e39e2cbf /spec | |
parent | 1db6661143b27a91050245fc4ffb8bca66a1354a (diff) |
Add latest changes from gitlab-org/gitlab@16-1-stable-ee
Diffstat (limited to 'spec')
-rw-r--r-- | spec/uploaders/object_storage_spec.rb | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/spec/uploaders/object_storage_spec.rb b/spec/uploaders/object_storage_spec.rb index a748c544bfd..8c33224968d 100644 --- a/spec/uploaders/object_storage_spec.rb +++ b/spec/uploaders/object_storage_spec.rb @@ -1097,19 +1097,31 @@ RSpec.describe ObjectStorage, :clean_gitlab_redis_shared_state, feature_category let(:fog_config) do Gitlab.config.uploads.object_store.tap do |config| config[:remote_directory] = 'main-bucket' - config[:bucket_prefix] = 'uploads' + config[:bucket_prefix] = 'my/uploads' end end let(:bucket) { 'main-bucket' } - let(:fog_file_path) { "uploads/#{final_path}" } + let(:fog_file_path) { "my/uploads/#{final_path}" } it 'stores the file final path in the db without the prefix' do expect { subject }.not_to raise_error - expect(uploader.store_path).to eq("uploads/#{final_path}") + expect(uploader.store_path).to eq("my/uploads/#{final_path}") expect(object.file_final_path).to eq(final_path) end + + context 'and file is stored' do + subject do + uploader.store!(uploaded_file) + end + + it 'completes the matching pending upload entry' do + expect { subject } + .to change { ObjectStorage::PendingDirectUpload.exists?(uploader_class.storage_location_identifier, final_path) } + .to(false) + end + end end context 'when file is stored' do |