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/workers/gitlab/github_import/stage/import_repository_worker_spec.rb')
-rw-r--r--spec/workers/gitlab/github_import/stage/import_repository_worker_spec.rb34
1 files changed, 2 insertions, 32 deletions
diff --git a/spec/workers/gitlab/github_import/stage/import_repository_worker_spec.rb b/spec/workers/gitlab/github_import/stage/import_repository_worker_spec.rb
index 94d8155d371..f4a306eeb0c 100644
--- a/spec/workers/gitlab/github_import/stage/import_repository_worker_spec.rb
+++ b/spec/workers/gitlab/github_import/stage/import_repository_worker_spec.rb
@@ -7,6 +7,8 @@ RSpec.describe Gitlab::GithubImport::Stage::ImportRepositoryWorker, feature_cate
let(:worker) { described_class.new }
+ it_behaves_like Gitlab::GithubImport::StageMethods
+
describe '#import' do
before do
expect(Gitlab::GithubImport::RefreshImportJidWorker)
@@ -84,37 +86,5 @@ RSpec.describe Gitlab::GithubImport::Stage::ImportRepositoryWorker, feature_cate
end
end
end
-
- context 'when the import fails' do
- it 'does not schedule the importing of the base data' do
- client = double(:client)
- exception_class = Gitlab::Git::Repository::NoRepository
-
- expect_next_instance_of(Gitlab::GithubImport::Importer::RepositoryImporter) do |instance|
- expect(instance).to receive(:execute).and_raise(exception_class)
- end
-
- expect(InternalId).to receive(:exists?).and_return(false)
- expect(client).to receive(:each_object).and_return([nil].each)
- expect(Issue).not_to receive(:track_namespace_iid!)
-
- expect(Gitlab::Import::ImportFailureService).to receive(:track)
- .with(
- project_id: project.id,
- exception: exception_class,
- error_source: described_class.name,
- fail_import: true,
- metrics: true
- ).and_call_original
-
- expect(Gitlab::GithubImport::Stage::ImportBaseDataWorker)
- .not_to receive(:perform_async)
-
- expect(worker.abort_on_failure).to eq(true)
-
- expect { worker.import(client, project) }
- .to raise_error(exception_class)
- end
- end
end
end