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>2021-06-16 21:25:58 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-06-16 21:25:58 +0300
commita5f4bba440d7f9ea47046a0a561d49adf0a1e6d4 (patch)
treefb69158581673816a8cd895f9d352dcb3c678b1e /spec/features/admin/admin_settings_spec.rb
parentd16b2e8639e99961de6ddc93909f3bb5c1445ba1 (diff)
Add latest changes from gitlab-org/gitlab@14-0-stable-eev14.0.0-rc42
Diffstat (limited to 'spec/features/admin/admin_settings_spec.rb')
-rw-r--r--spec/features/admin/admin_settings_spec.rb46
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