summaryrefslogtreecommitdiff
path: root/spec/services/projects/import_export/export_service_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/services/projects/import_export/export_service_spec.rb')
-rw-r--r--spec/services/projects/import_export/export_service_spec.rb15
1 files changed, 14 insertions, 1 deletions
diff --git a/spec/services/projects/import_export/export_service_spec.rb b/spec/services/projects/import_export/export_service_spec.rb
index 6002aaf427a..54abbc04084 100644
--- a/spec/services/projects/import_export/export_service_spec.rb
+++ b/spec/services/projects/import_export/export_service_spec.rb
@@ -93,11 +93,23 @@ RSpec.describe Projects::ImportExport::ExportService do
end
it 'saves the project in the file system' do
- expect(Gitlab::ImportExport::Saver).to receive(:save).with(exportable: project, shared: shared)
+ expect(Gitlab::ImportExport::Saver).to receive(:save).with(exportable: project, shared: shared).and_return(true)
service.execute
end
+ context 'when the upload fails' do
+ before do
+ expect(Gitlab::ImportExport::Saver).to receive(:save).with(exportable: project, shared: shared).and_return(false)
+ end
+
+ it 'notifies the user of an error' do
+ expect(service).to receive(:notify_error).and_call_original
+
+ expect { service.execute }.to raise_error(Gitlab::ImportExport::Error)
+ end
+ end
+
it 'calls the after export strategy' do
expect(after_export_strategy).to receive(:execute)
@@ -107,6 +119,7 @@ RSpec.describe Projects::ImportExport::ExportService do
context 'when after export strategy fails' do
before do
allow(after_export_strategy).to receive(:execute).and_return(false)
+ expect(Gitlab::ImportExport::Saver).to receive(:save).with(exportable: project, shared: shared).and_return(true)
end
after do