diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-28 06:08:41 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-28 06:08:41 +0300 |
commit | a22f031743db01e51ee4f85c3368aa21cf8ac729 (patch) | |
tree | 58b4aabab8e8acfd684b63b05da2cd2cb6a177a6 /spec/lib/gitlab/github_import | |
parent | d690a8d62bc0abd5ab937822ff7a1b9f1e7b1a91 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/github_import')
-rw-r--r-- | spec/lib/gitlab/github_import/client_spec.rb | 26 | ||||
-rw-r--r-- | spec/lib/gitlab/github_import/sequential_importer_spec.rb | 2 |
2 files changed, 27 insertions, 1 deletions
diff --git a/spec/lib/gitlab/github_import/client_spec.rb b/spec/lib/gitlab/github_import/client_spec.rb index 5f6ab42d0d2..20e84bacd55 100644 --- a/spec/lib/gitlab/github_import/client_spec.rb +++ b/spec/lib/gitlab/github_import/client_spec.rb @@ -299,6 +299,32 @@ RSpec.describe Gitlab::GithubImport::Client do end end + describe '#web_endpoint' do + let(:client) { described_class.new('foo') } + + context 'without a custom endpoint configured in Omniauth' do + it 'returns the default web endpoint' do + expect(client) + .to receive(:custom_api_endpoint) + .and_return(nil) + + expect(client.web_endpoint).to eq('https://github.com') + end + end + + context 'with a custom endpoint configured in Omniauth' do + it 'returns the custom endpoint' do + endpoint = 'https://github.kittens.com' + + expect(client) + .to receive(:custom_api_endpoint) + .and_return(endpoint) + + expect(client.web_endpoint).to eq(endpoint) + end + end + end + describe '#custom_api_endpoint' do let(:client) { described_class.new('foo') } diff --git a/spec/lib/gitlab/github_import/sequential_importer_spec.rb b/spec/lib/gitlab/github_import/sequential_importer_spec.rb index fe13fcd2568..a5e89049ed9 100644 --- a/spec/lib/gitlab/github_import/sequential_importer_spec.rb +++ b/spec/lib/gitlab/github_import/sequential_importer_spec.rb @@ -6,7 +6,7 @@ RSpec.describe Gitlab::GithubImport::SequentialImporter do describe '#execute' do it 'imports a project in sequence' do repository = double(:repository) - project = double(:project, id: 1, repository: repository) + project = double(:project, id: 1, repository: repository, import_url: 'http://t0ken@github.another-domain.com/repo-org/repo.git') importer = described_class.new(project, token: 'foo') expect_next_instance_of(Gitlab::GithubImport::Importer::RepositoryImporter) do |instance| |