diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-20 09:40:42 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-20 09:40:42 +0000 |
commit | ee664acb356f8123f4f6b00b73c1e1cf0866c7fb (patch) | |
tree | f8479f94a28f66654c6a4f6fb99bad6b4e86a40e /spec/services/bulk_imports/repository_bundle_export_service_spec.rb | |
parent | 62f7d5c5b69180e82ae8196b7b429eeffc8e7b4f (diff) | |
download | gitlab-ce-ee664acb356f8123f4f6b00b73c1e1cf0866c7fb.tar.gz |
Add latest changes from gitlab-org/gitlab@15-5-stable-eev15.5.0-rc42
Diffstat (limited to 'spec/services/bulk_imports/repository_bundle_export_service_spec.rb')
-rw-r--r-- | spec/services/bulk_imports/repository_bundle_export_service_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/services/bulk_imports/repository_bundle_export_service_spec.rb b/spec/services/bulk_imports/repository_bundle_export_service_spec.rb index a7d98a7474a..f0d63de1ab9 100644 --- a/spec/services/bulk_imports/repository_bundle_export_service_spec.rb +++ b/spec/services/bulk_imports/repository_bundle_export_service_spec.rb @@ -17,6 +17,7 @@ RSpec.describe BulkImports::RepositoryBundleExportService do context 'when repository exists' do it 'bundles repository to disk' do allow(repository).to receive(:exists?).and_return(true) + allow(repository).to receive(:empty?).and_return(false) expect(repository).to receive(:bundle_to_disk).with(File.join(export_path, "#{export_filename}.bundle")) service.execute @@ -31,6 +32,15 @@ RSpec.describe BulkImports::RepositoryBundleExportService do service.execute end end + + context 'when repository is empty' do + it 'does not bundle repository to disk' do + allow(repository).to receive(:empty?).and_return(true) + expect(repository).not_to receive(:bundle_to_disk) + + service.execute + end + end end include_examples 'repository export' do |