diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-03 03:07:58 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-03 03:07:58 +0000 |
commit | 1eeef229aae5affdce415c2364858e8efc64f4b5 (patch) | |
tree | 7bbd126a3b41c4c8855a8e84ece3972030177acb /spec/services/projects | |
parent | 5d32a7a175fd1a7a6c97019a022c11434ea637dc (diff) | |
download | gitlab-ce-1eeef229aae5affdce415c2364858e8efc64f4b5.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 | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/spec/services/projects/import_service_spec.rb b/spec/services/projects/import_service_spec.rb index 1e9ac40128a..af8118f9b11 100644 --- a/spec/services/projects/import_service_spec.rb +++ b/spec/services/projects/import_service_spec.rb @@ -123,8 +123,13 @@ describe Projects::ImportService do it 'succeeds if repository import is successful' do 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) + expect_next_instance_of(Gitlab::BitbucketImport::Importer) do |importer| + expect(importer).to receive(:execute).and_return(true) + end + + expect_next_instance_of(Projects::LfsPointers::LfsImportService) do |service| + expect(service).to receive(:execute).and_return(status: :success) + end result = subject.execute @@ -147,8 +152,15 @@ describe Projects::ImportService do error_message = 'error message' 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_next_instance_of(Gitlab::BitbucketImport::Importer) do |importer| + expect(importer).to receive(:execute).and_return(true) + end + + expect_next_instance_of(Projects::LfsPointers::LfsImportService) do |service| + expect(service).to receive(:execute).and_return(status: :error, message: error_message) + end + expect(Gitlab::AppLogger).to receive(:error).with("The Lfs import process failed. #{error_message}") subject.execute |