summaryrefslogtreecommitdiff
path: root/spec/services/import_export_clean_up_service_spec.rb
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2018-06-25 15:10:26 +0200
committerJames Lopez <james@jameslopez.es>2018-07-06 15:46:18 +0200
commita2bf1641546a1d3eeb3e9f44734854f655c0adef (patch)
tree0652c20a92513330aa09c4a2ec9adbfaeb3a6494 /spec/services/import_export_clean_up_service_spec.rb
parentb0fa01fce3822da94aee6264829841996beb6df3 (diff)
downloadgitlab-ce-a2bf1641546a1d3eeb3e9f44734854f655c0adef.tar.gz
Update Import/Export to use object storage (based on aa feature flag)
Diffstat (limited to 'spec/services/import_export_clean_up_service_spec.rb')
-rw-r--r--spec/services/import_export_clean_up_service_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/services/import_export_clean_up_service_spec.rb b/spec/services/import_export_clean_up_service_spec.rb
index 1875d0448cd..de8ce9b6392 100644
--- a/spec/services/import_export_clean_up_service_spec.rb
+++ b/spec/services/import_export_clean_up_service_spec.rb
@@ -38,6 +38,24 @@ describe ImportExportCleanUpService do
end
end
+ context 'with uploader exports' do
+ it 'removes old files' do
+ upload = create(:import_export_upload,
+ updated_at: 2.days.ago,
+ export_file: fixture_file_upload('spec/fixtures/project_export.tar.gz'))
+
+ expect { service.execute }.to change { upload.reload.export_file.file.nil? }.to(true)
+ end
+
+ it 'does not remove new files' do
+ upload = create(:import_export_upload,
+ updated_at: 1.hour.ago,
+ export_file: fixture_file_upload('spec/fixtures/project_export.tar.gz'))
+
+ expect { service.execute }.not_to change { upload.reload.export_file.file.nil? }
+ end
+ end
+
def in_directory_with_files(mtime:)
Dir.mktmpdir do |tmpdir|
stub_repository_downloads_path(tmpdir)