diff options
Diffstat (limited to 'spec/services/bulk_imports/file_export_service_spec.rb')
-rw-r--r-- | spec/services/bulk_imports/file_export_service_spec.rb | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/spec/services/bulk_imports/file_export_service_spec.rb b/spec/services/bulk_imports/file_export_service_spec.rb index 0d129c75384..94efceff6c6 100644 --- a/spec/services/bulk_imports/file_export_service_spec.rb +++ b/spec/services/bulk_imports/file_export_service_spec.rb @@ -5,7 +5,7 @@ require 'spec_helper' RSpec.describe BulkImports::FileExportService do let_it_be(:project) { create(:project) } let_it_be(:export_path) { Dir.mktmpdir } - let_it_be(:relation) { 'uploads' } + let_it_be(:relation) { BulkImports::FileTransfer::BaseConfig::UPLOADS_RELATION } subject(:service) { described_class.new(project, export_path, relation) } @@ -20,6 +20,20 @@ RSpec.describe BulkImports::FileExportService do subject.execute end + context 'when relation is lfs objects' do + let_it_be(:relation) { BulkImports::FileTransfer::ProjectConfig::LFS_OBJECTS_RELATION } + + it 'executes lfs objects export service' do + expect_next_instance_of(BulkImports::LfsObjectsExportService) do |service| + expect(service).to receive(:execute) + end + + expect(subject).to receive(:tar_cf).with(archive: File.join(export_path, 'lfs_objects.tar'), dir: export_path) + + subject.execute + end + end + context 'when unsupported relation is passed' do it 'raises an error' do service = described_class.new(project, export_path, 'unsupported') |