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/config/settings_spec.rb')
-rw-r--r--spec/config/settings_spec.rb36
1 files changed, 36 insertions, 0 deletions
diff --git a/spec/config/settings_spec.rb b/spec/config/settings_spec.rb
index 4917b043812..0928f2b72ff 100644
--- a/spec/config/settings_spec.rb
+++ b/spec/config/settings_spec.rb
@@ -3,6 +3,8 @@
require 'spec_helper'
RSpec.describe Settings, feature_category: :authentication_and_authorization do
+ using RSpec::Parameterized::TableSyntax
+
describe 'omniauth' do
it 'defaults to enabled' do
expect(described_class.omniauth.enabled).to be true
@@ -15,6 +17,32 @@ RSpec.describe Settings, feature_category: :authentication_and_authorization do
end
end
+ describe '.build_ci_component_fqdn' do
+ subject(:fqdn) { described_class.build_ci_component_fqdn }
+
+ where(:host, :port, :relative_url, :result) do
+ 'acme.com' | 9090 | '/gitlab' | 'acme.com:9090/gitlab/'
+ 'acme.com' | 443 | '/gitlab' | 'acme.com/gitlab/'
+ 'acme.com' | 443 | '' | 'acme.com/'
+ 'acme.com' | 9090 | '' | 'acme.com:9090/'
+ 'test' | 9090 | '' | 'test:9090/'
+ end
+
+ with_them do
+ before do
+ allow(Gitlab.config).to receive(:gitlab).and_return(
+ Settingslogic.new({
+ 'host' => host,
+ 'https' => true,
+ 'port' => port,
+ 'relative_url_root' => relative_url
+ }))
+ end
+
+ it { is_expected.to eq(result) }
+ end
+ end
+
describe '.attr_encrypted_db_key_base_truncated' do
it 'is a string with maximum 32 bytes size' do
expect(described_class.attr_encrypted_db_key_base_truncated.bytesize)
@@ -162,4 +190,12 @@ RSpec.describe Settings, feature_category: :authentication_and_authorization do
expect(described_class.microsoft_graph_mailer.graph_endpoint).to eq('https://graph.microsoft.com')
end
end
+
+ describe '.repositories' do
+ it 'sets up storage settings' do
+ described_class.repositories.storages.each do |_, storage|
+ expect(storage).to be_a Gitlab::GitalyClient::StorageSettings
+ end
+ end
+ end
end