diff options
Diffstat (limited to 'spec/models/application_setting_spec.rb')
-rw-r--r-- | spec/models/application_setting_spec.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/models/application_setting_spec.rb b/spec/models/application_setting_spec.rb index 77bb6b502b5..fd86a784b2d 100644 --- a/spec/models/application_setting_spec.rb +++ b/spec/models/application_setting_spec.rb @@ -17,6 +17,14 @@ RSpec.describe ApplicationSetting do it { expect(setting.uuid).to be_present } it { expect(setting).to have_db_column(:auto_devops_enabled) } + describe 'default values' do + subject(:setting) { described_class.new } + + it { expect(setting.id).to eq(1) } + it { expect(setting.repository_storages_weighted).to eq({}) } + it { expect(setting.kroki_formats).to eq({}) } + end + describe 'validations' do let(:http) { 'http://example.com' } let(:https) { 'https://example.com' } @@ -203,6 +211,9 @@ RSpec.describe ApplicationSetting do it { is_expected.to allow_value([]).for(:valid_runner_registrars) } it { is_expected.to allow_value(%w(project group)).for(:valid_runner_registrars) } + it { is_expected.to allow_value(http).for(:jira_connect_proxy_url) } + it { is_expected.to allow_value(https).for(:jira_connect_proxy_url) } + context 'when deactivate_dormant_users is enabled' do before do stub_application_setting(deactivate_dormant_users: true) @@ -261,6 +272,7 @@ RSpec.describe ApplicationSetting do end it { is_expected.not_to allow_value('http://localhost:9000').for(:grafana_url) } + it { is_expected.not_to allow_value('http://localhost:9000').for(:jira_connect_proxy_url) } end context 'with invalid grafana URL' do @@ -1121,6 +1133,11 @@ RSpec.describe ApplicationSetting do it { is_expected.to validate_presence_of(:error_tracking_api_url) } end end + + context 'for default_preferred_language' do + it { is_expected.to allow_value(*Gitlab::I18n.available_locales).for(:default_preferred_language) } + it { is_expected.not_to allow_value(nil, '', 'invalid_locale').for(:default_preferred_language) } + end end context 'restrict creating duplicates' do |