diff options
Diffstat (limited to 'spec/features/admin/admin_settings_spec.rb')
-rw-r--r-- | spec/features/admin/admin_settings_spec.rb | 46 |
1 files changed, 33 insertions, 13 deletions
diff --git a/spec/features/admin/admin_settings_spec.rb b/spec/features/admin/admin_settings_spec.rb index 0a7113a5559..c289c18126d 100644 --- a/spec/features/admin/admin_settings_spec.rb +++ b/spec/features/admin/admin_settings_spec.rb @@ -8,9 +8,11 @@ RSpec.describe 'Admin updates settings' do include UsageDataHelpers let(:admin) { create(:admin) } + let(:dot_com?) { false } context 'application setting :admin_mode is enabled', :request_store do before do + allow(Gitlab).to receive(:com?).and_return(dot_com?) stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false') sign_in(admin) gitlab_enable_admin_mode_sign_in(admin) @@ -127,6 +129,37 @@ RSpec.describe 'Admin updates settings' do expect(user_internal_regex['placeholder']).to eq 'Regex pattern' end + context 'Dormant users' do + context 'when Gitlab.com' do + let(:dot_com?) { true } + + it 'does not expose the setting' do + expect(page).to have_no_selector('#application_setting_deactivate_dormant_users') + end + end + + context 'when not Gitlab.com' do + let(:dot_com?) { false } + + it 'change Dormant users' do + expect(page).to have_unchecked_field('Deactivate dormant users after 90 days of inactivity') + expect(current_settings.deactivate_dormant_users).to be_falsey + + page.within('.as-account-limit') do + check 'application_setting_deactivate_dormant_users' + click_button 'Save changes' + end + + expect(page).to have_content "Application settings saved successfully" + + page.refresh + + expect(current_settings.deactivate_dormant_users).to be_truthy + expect(page).to have_checked_field('Deactivate dormant users after 90 days of inactivity') + end + end + end + context 'Change Sign-up restrictions' do context 'Require Admin approval for new signup setting' do it 'changes the setting', :js do @@ -315,19 +348,6 @@ RSpec.describe 'Admin updates settings' do visit integrations_admin_application_settings_path end - it 'allows user to dismiss deprecation notice' do - expect(page).to have_content('Some settings have moved') - - click_button 'Dismiss' - wait_for_requests - - expect(page).not_to have_content('Some settings have moved') - - visit integrations_admin_application_settings_path - - expect(page).not_to have_content('Some settings have moved') - end - it 'shows integrations table' do expect(page).to have_selector '[data-testid="inactive-integrations-table"]' end |