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/tasks/gitlab/import_export/import_rake_spec.rb')
-rw-r--r--spec/tasks/gitlab/import_export/import_rake_spec.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/spec/tasks/gitlab/import_export/import_rake_spec.rb b/spec/tasks/gitlab/import_export/import_rake_spec.rb
index e8507e63bf5..18b89912b9f 100644
--- a/spec/tasks/gitlab/import_export/import_rake_spec.rb
+++ b/spec/tasks/gitlab/import_export/import_rake_spec.rb
@@ -2,7 +2,7 @@
require 'rake_helper'
-describe 'gitlab:import_export:import rake task' do
+describe 'gitlab:import_export:import rake task', :sidekiq do
let(:username) { 'root' }
let(:namespace_path) { username }
let!(:user) { create(:user, username: username) }
@@ -12,6 +12,8 @@ describe 'gitlab:import_export:import rake task' do
before do
Rake.application.rake_require('tasks/gitlab/import_export/import')
allow(Settings.uploads.object_store).to receive(:[]=).and_call_original
+ allow_any_instance_of(GitlabProjectImport).to receive(:exit)
+ .and_raise(RuntimeError, 'exit not handled')
end
around do |example|
@@ -95,6 +97,10 @@ describe 'gitlab:import_export:import rake task' do
end
it 'fails project import with an error' do
+ # Catch exit call, and raise exception instead
+ expect_any_instance_of(GitlabProjectImport).to receive(:exit)
+ .with(1).and_raise(SystemExit)
+
expect { subject }.to raise_error(SystemExit).and output(error).to_stdout
expect(project.merge_requests).to be_empty