diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-02 21:06:51 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-02 21:06:51 +0000 |
commit | a19a376bf35b2009566e86b8190662c21ed7e2ba (patch) | |
tree | 46d3ea7f44a0a732b96fcbae0cf09d3cfd8ec9dc /spec/tasks | |
parent | 556c79d6cc3d7b24ecbba3a79f8432eb3fcf5c7e (diff) | |
download | gitlab-ce-a19a376bf35b2009566e86b8190662c21ed7e2ba.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/tasks')
-rw-r--r-- | spec/tasks/gitlab/import_export/import_rake_spec.rb | 8 |
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 |