Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/services/groups/import_export/export_service_spec.rb')
-rw-r--r--spec/services/groups/import_export/export_service_spec.rb21
1 files changed, 12 insertions, 9 deletions
diff --git a/spec/services/groups/import_export/export_service_spec.rb b/spec/services/groups/import_export/export_service_spec.rb
index 7bad68b4e00..ea49b26cc7c 100644
--- a/spec/services/groups/import_export/export_service_spec.rb
+++ b/spec/services/groups/import_export/export_service_spec.rb
@@ -103,12 +103,14 @@ describe Groups::ImportExport::ExportService do
end
it 'logs the error' do
- expect(shared.logger).to receive(:error).with(
- group_id: group.id,
- group_name: group.name,
- error: expected_message,
- message: 'Group Import/Export: Export failed'
- )
+ expect_next_instance_of(Gitlab::Export::Logger) do |logger|
+ expect(logger).to receive(:error).with(
+ group_id: group.id,
+ group_name: group.name,
+ errors: expected_message,
+ message: 'Group Export failed'
+ )
+ end
expect { service.execute }.to raise_error(Gitlab::ImportExport::Error)
end
@@ -132,7 +134,7 @@ describe Groups::ImportExport::ExportService do
expect { service.execute }.to raise_error(Gitlab::ImportExport::Error)
expect(group.import_export_upload).to be_nil
- expect(File.exist?(shared.archive_path)).to eq(false)
+ expect(Dir.exist?(shared.base_path)).to eq(false)
end
it 'notifies the user about failed group export' do
@@ -157,12 +159,13 @@ describe Groups::ImportExport::ExportService do
expect { service.execute }.to raise_error(Gitlab::ImportExport::Error)
expect(group.import_export_upload).to be_nil
- expect(File.exist?(shared.archive_path)).to eq(false)
+ expect(Dir.exist?(shared.base_path)).to eq(false)
end
it 'notifies logger' do
allow(service).to receive_message_chain(:tree_exporter, :save).and_return(false)
- expect(shared.logger).to receive(:error)
+
+ expect(service.instance_variable_get(:@logger)).to receive(:error)
expect { service.execute }.to raise_error(Gitlab::ImportExport::Error)
end