diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-17 21:09:16 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-17 21:09:16 +0000 |
commit | 154b9bae142ba15fec753f44327654595094b879 (patch) | |
tree | 027f8ae024961778d5b00c77a72fe302f985d4f3 /spec/services/projects | |
parent | 2c156e3c7bbade01c36eee18327f1ced6eebea79 (diff) | |
download | gitlab-ce-154b9bae142ba15fec753f44327654595094b879.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services/projects')
-rw-r--r-- | spec/services/projects/import_service_spec.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/spec/services/projects/import_service_spec.rb b/spec/services/projects/import_service_spec.rb index d9f9ede8ecd..1e9ac40128a 100644 --- a/spec/services/projects/import_service_spec.rb +++ b/spec/services/projects/import_service_spec.rb @@ -122,7 +122,7 @@ describe Projects::ImportService do end it 'succeeds if repository import is successful' do - expect_any_instance_of(Gitlab::Shell).to receive(:import_repository).and_return(true) + expect(project.repository).to receive(:import_repository).and_return(true) expect_any_instance_of(Gitlab::BitbucketImport::Importer).to receive(:execute).and_return(true) expect_any_instance_of(Projects::LfsPointers::LfsImportService).to receive(:execute).and_return(status: :success) @@ -132,7 +132,9 @@ describe Projects::ImportService do end it 'fails if repository import fails' do - expect_any_instance_of(Gitlab::Shell).to receive(:import_repository).and_raise(Gitlab::Shell::Error.new('Failed to import the repository /a/b/c')) + expect(project.repository) + .to receive(:import_repository) + .and_raise(Gitlab::Git::CommandError, 'Failed to import the repository /a/b/c') result = subject.execute @@ -144,7 +146,7 @@ describe Projects::ImportService do it 'logs the error' do error_message = 'error message' - expect_any_instance_of(Gitlab::Shell).to receive(:import_repository).and_return(true) + expect(project.repository).to receive(:import_repository).and_return(true) expect_any_instance_of(Gitlab::BitbucketImport::Importer).to receive(:execute).and_return(true) expect_any_instance_of(Projects::LfsPointers::LfsImportService).to receive(:execute).and_return(status: :error, message: error_message) expect(Gitlab::AppLogger).to receive(:error).with("The Lfs import process failed. #{error_message}") @@ -155,7 +157,7 @@ describe Projects::ImportService do context 'when repository import scheduled' do before do - allow_any_instance_of(Gitlab::Shell).to receive(:import_repository).and_return(true) + expect(project.repository).to receive(:import_repository).and_return(true) allow(subject).to receive(:import_data) end |