diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-14 06:07:52 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-14 06:07:52 +0300 |
commit | 5e99b288a022aaf47f1d33802f4f96eb8e00084b (patch) | |
tree | 47dcc37acf51fc70b4234cca4354851843d47886 /spec/services | |
parent | e2d4a6dedbb55154ff9389dbe061fa74ccbae287 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services')
-rw-r--r-- | spec/services/groups/import_export/export_service_spec.rb | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/spec/services/groups/import_export/export_service_spec.rb b/spec/services/groups/import_export/export_service_spec.rb index b78e2f0bc40..7bad68b4e00 100644 --- a/spec/services/groups/import_export/export_service_spec.rb +++ b/spec/services/groups/import_export/export_service_spec.rb @@ -71,6 +71,14 @@ describe Groups::ImportExport::ExportService do service.execute end + it 'notifies the user' do + expect_next_instance_of(NotificationService) do |instance| + expect(instance).to receive(:group_was_exported) + end + + service.execute + end + context 'when saver succeeds' do it 'saves the group in the file system' do service.execute @@ -114,16 +122,26 @@ describe Groups::ImportExport::ExportService do context 'when export fails' do context 'when file saver fails' do - it 'removes the remaining exported data' do + before do allow_next_instance_of(Gitlab::ImportExport::Saver) do |saver| allow(saver).to receive(:save).and_return(false) end + end + it 'removes the remaining exported data' 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) end + + it 'notifies the user about failed group export' do + expect_next_instance_of(NotificationService) do |instance| + expect(instance).to receive(:group_was_not_exported) + end + + expect { service.execute }.to raise_error(Gitlab::ImportExport::Error) + end end context 'when file compression fails' do |