diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-30 18:28:44 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-30 18:28:44 +0300 |
commit | 8cf61c17e9f20827896c44b1e0a1287b5a5dc507 (patch) | |
tree | 0077758ac9600d2e72451bf774bbe5932c5171c0 /spec | |
parent | 427cb4dfa77bccf1594503a7e00d7e782e281c16 (diff) |
Add latest changes from gitlab-org/gitlab@16-1-stable-ee
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/gitlab/legacy_github_import/client_spec.rb | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/spec/lib/gitlab/legacy_github_import/client_spec.rb b/spec/lib/gitlab/legacy_github_import/client_spec.rb index 757bdd8dd6c..4aea7308e37 100644 --- a/spec/lib/gitlab/legacy_github_import/client_spec.rb +++ b/spec/lib/gitlab/legacy_github_import/client_spec.rb @@ -4,7 +4,8 @@ require 'spec_helper' RSpec.describe Gitlab::LegacyGithubImport::Client, feature_category: :importers do let(:token) { '123456' } - let(:github_provider) { GitlabSettings::Options.build('app_id' => 'asd123', 'app_secret' => 'asd123', 'name' => 'github', 'args' => { 'client_options' => {} }) } + let(:github_provider) { GitlabSettings::Options.build('app_id' => 'asd123', 'app_secret' => 'asd123', 'name' => 'github', 'args' => { 'client_options' => client_options }) } + let(:client_options) { {} } let(:wait_for_rate_limit_reset) { true } subject(:client) { described_class.new(token, wait_for_rate_limit_reset: wait_for_rate_limit_reset) } @@ -13,8 +14,19 @@ RSpec.describe Gitlab::LegacyGithubImport::Client, feature_category: :importers allow(Gitlab.config.omniauth).to receive(:providers).and_return([github_provider]) end - it 'convert OAuth2 client options to symbols' do - expect(client.client.options.keys).to all(be_kind_of(Symbol)) + context 'with client options' do + let(:client_options) do + { + 'authorize_url' => 'https://github.com/login/oauth/authorize', + 'token_url' => 'https://github.com/login/oauth/access_token' + } + end + + it 'convert OAuth2 client options to symbols' do + expect(client.client.options.keys).to all(be_kind_of(Symbol)) + expect(client.client.options[:authorize_url]).to eq(client_options['authorize_url']) + expect(client.client.options[:token_url]).to eq(client_options['token_url']) + end end it 'does not crash (e.g. GitlabSettings::MissingSetting) when verify_ssl config is not present' do |