summaryrefslogtreecommitdiff
path: root/spec/features/admin/admin_settings_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-10-20 09:40:42 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-10-20 09:40:42 +0000
commitee664acb356f8123f4f6b00b73c1e1cf0866c7fb (patch)
treef8479f94a28f66654c6a4f6fb99bad6b4e86a40e /spec/features/admin/admin_settings_spec.rb
parent62f7d5c5b69180e82ae8196b7b429eeffc8e7b4f (diff)
downloadgitlab-ce-ee664acb356f8123f4f6b00b73c1e1cf0866c7fb.tar.gz
Add latest changes from gitlab-org/gitlab@15-5-stable-eev15.5.0-rc42
Diffstat (limited to 'spec/features/admin/admin_settings_spec.rb')
-rw-r--r--spec/features/admin/admin_settings_spec.rb44
1 files changed, 12 insertions, 32 deletions
diff --git a/spec/features/admin/admin_settings_spec.rb b/spec/features/admin/admin_settings_spec.rb
index a5df142d188..94c5f397670 100644
--- a/spec/features/admin/admin_settings_spec.rb
+++ b/spec/features/admin/admin_settings_spec.rb
@@ -7,7 +7,7 @@ RSpec.describe 'Admin updates settings' do
include TermsHelper
include UsageDataHelpers
- let(:admin) { create(:admin) }
+ let_it_be(:admin) { create(:admin) }
let(:dot_com?) { false }
context 'application setting :admin_mode is enabled', :request_store do
@@ -177,10 +177,10 @@ RSpec.describe 'Admin updates settings' do
end
it 'change Dormant users period' do
- expect(page).to have_field _('Period of inactivity (days)')
+ expect(page).to have_field _('Days of inactivity before deactivation')
page.within(find('[data-testid="account-limit"]')) do
- fill_in _('application_setting_deactivate_dormant_users_period'), with: '35'
+ fill_in _('application_setting_deactivate_dormant_users_period'), with: '90'
click_button 'Save changes'
end
@@ -188,7 +188,7 @@ RSpec.describe 'Admin updates settings' do
page.refresh
- expect(page).to have_field _('Period of inactivity (days)'), with: '35'
+ expect(page).to have_field _('Days of inactivity before deactivation'), with: '90'
end
end
end
@@ -400,39 +400,19 @@ RSpec.describe 'Admin updates settings' do
end
context 'Runner Registration' do
- context 'when feature is enabled' do
- before do
- stub_feature_flags(runner_registration_control: true)
- end
-
- it 'allows admins to control who has access to register runners' do
- visit ci_cd_admin_application_settings_path
-
- expect(current_settings.valid_runner_registrars).to eq(ApplicationSetting::VALID_RUNNER_REGISTRAR_TYPES)
+ it 'allows admins to control who has access to register runners' do
+ visit ci_cd_admin_application_settings_path
- page.within('.as-runner') do
- find_all('input[type="checkbox"]').each(&:click)
+ expect(current_settings.valid_runner_registrars).to eq(ApplicationSetting::VALID_RUNNER_REGISTRAR_TYPES)
- click_button 'Save changes'
- end
-
- expect(current_settings.valid_runner_registrars).to eq([])
- expect(page).to have_content "Application settings saved successfully"
- end
- end
+ page.within('.as-runner') do
+ find_all('input[type="checkbox"]').each(&:click)
- context 'when feature is disabled' do
- before do
- stub_feature_flags(runner_registration_control: false)
+ click_button 'Save changes'
end
- it 'does not allow admins to control who has access to register runners' do
- visit ci_cd_admin_application_settings_path
-
- expect(current_settings.valid_runner_registrars).to eq(ApplicationSetting::VALID_RUNNER_REGISTRAR_TYPES)
-
- expect(page).not_to have_css('.as-runner')
- end
+ expect(current_settings.valid_runner_registrars).to eq([])
+ expect(page).to have_content "Application settings saved successfully"
end
end