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:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-04-20 13:00:54 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-04-20 13:00:54 +0300
commit3cccd102ba543e02725d247893729e5c73b38295 (patch)
treef36a04ec38517f5deaaacb5acc7d949688d1e187 /spec/initializers
parent205943281328046ef7b4528031b90fbda70c75ac (diff)
Add latest changes from gitlab-org/gitlab@14-10-stable-eev14.10.0-rc42
Diffstat (limited to 'spec/initializers')
-rw-r--r--spec/initializers/mail_encoding_patch_spec.rb3
-rw-r--r--spec/initializers/omniauth_spec.rb46
2 files changed, 48 insertions, 1 deletions
diff --git a/spec/initializers/mail_encoding_patch_spec.rb b/spec/initializers/mail_encoding_patch_spec.rb
index 52a0d041f48..12539c9ca52 100644
--- a/spec/initializers/mail_encoding_patch_spec.rb
+++ b/spec/initializers/mail_encoding_patch_spec.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
+# rubocop:disable RSpec/VariableDefinition, RSpec/VariableName
require 'fast_spec_helper'
-
require 'mail'
require_relative '../../config/initializers/mail_encoding_patch'
@@ -205,3 +205,4 @@ RSpec.describe 'Mail quoted-printable transfer encoding patch and Unicode charac
end
end
end
+# rubocop:enable RSpec/VariableDefinition, RSpec/VariableName
diff --git a/spec/initializers/omniauth_spec.rb b/spec/initializers/omniauth_spec.rb
new file mode 100644
index 00000000000..928eac8c533
--- /dev/null
+++ b/spec/initializers/omniauth_spec.rb
@@ -0,0 +1,46 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe 'OmniAuth initializer for GitLab' do
+ let(:load_omniauth_initializer) do
+ load Rails.root.join('config/initializers/omniauth.rb')
+ end
+
+ describe '#full_host' do
+ subject { OmniAuth.config.full_host }
+
+ let(:base_url) { 'http://localhost/test' }
+
+ before do
+ allow(Settings).to receive(:gitlab).and_return({ 'base_url' => base_url })
+ allow(Gitlab::OmniauthInitializer).to receive(:full_host).and_return('proc')
+ end
+
+ context 'with feature flags not available' do
+ before do
+ expect(Feature).to receive(:feature_flags_available?).and_return(false)
+ load_omniauth_initializer
+ end
+
+ it { is_expected.to eq(base_url) }
+ end
+
+ context 'with the omniauth_initializer_fullhost_proc FF disabled' do
+ before do
+ stub_feature_flags(omniauth_initializer_fullhost_proc: false)
+ load_omniauth_initializer
+ end
+
+ it { is_expected.to eq(base_url) }
+ end
+
+ context 'with the omniauth_initializer_fullhost_proc FF disabled' do
+ before do
+ load_omniauth_initializer
+ end
+
+ it { is_expected.to eq('proc') }
+ end
+ end
+end