diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 11:18:50 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 11:18:50 +0000 |
commit | 8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch) | |
tree | a77e7fe7a93de11213032ed4ab1f33a3db51b738 /spec/features/admin/admin_settings_spec.rb | |
parent | 00b35af3db1abfe813a778f643dad221aad51fca (diff) | |
download | gitlab-ce-8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781.tar.gz |
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'spec/features/admin/admin_settings_spec.rb')
-rw-r--r-- | spec/features/admin/admin_settings_spec.rb | 38 |
1 files changed, 33 insertions, 5 deletions
diff --git a/spec/features/admin/admin_settings_spec.rb b/spec/features/admin/admin_settings_spec.rb index 7ec3c2abb51..55f6a9930ff 100644 --- a/spec/features/admin/admin_settings_spec.rb +++ b/spec/features/admin/admin_settings_spec.rb @@ -2,9 +2,10 @@ require 'spec_helper' -describe 'Admin updates settings', :clean_gitlab_redis_shared_state, :do_not_mock_admin_mode do +RSpec.describe 'Admin updates settings', :clean_gitlab_redis_shared_state, :do_not_mock_admin_mode do include StubENV include TermsHelper + include UsageDataHelpers let(:admin) { create(:admin) } @@ -104,6 +105,16 @@ describe 'Admin updates settings', :clean_gitlab_redis_shared_state, :do_not_moc expect(page).to have_content "Application settings saved successfully" end + it 'Change Maximum import size' do + page.within('.as-account-limit') do + fill_in 'Maximum import size (MB)', with: 15 + click_button 'Save changes' + end + + expect(current_settings.max_import_size).to eq 15 + expect(page).to have_content "Application settings saved successfully" + end + it 'Change New users set to external', :js do user_internal_regex = find('#application_setting_user_default_internal_regex', visible: :all) @@ -277,16 +288,31 @@ describe 'Admin updates settings', :clean_gitlab_redis_shared_state, :do_not_moc end end + context 'Repository page' do + it 'Change Repository storage settings' do + visit repository_admin_application_settings_path + + page.within('.as-repository-storage') do + fill_in 'application_setting_repository_storages_weighted_default', with: 50 + click_button 'Save changes' + end + + expect(current_settings.repository_storages_weighted_default).to be 50 + end + end + context 'Reporting page' do it 'Change Spam settings' do visit reporting_admin_application_settings_path page.within('.as-spam') do - check 'Enable reCAPTCHA' - check 'Enable reCAPTCHA for login' fill_in 'reCAPTCHA Site Key', with: 'key' fill_in 'reCAPTCHA Private Key', with: 'key' + check 'Enable reCAPTCHA' + check 'Enable reCAPTCHA for login' fill_in 'IPs per user', with: 15 + check 'Enable Spam Check via external API endpoint' + fill_in 'URL of the external Spam Check endpoint', with: 'https://www.example.com/spamcheck' click_button 'Save changes' end @@ -294,6 +320,8 @@ describe 'Admin updates settings', :clean_gitlab_redis_shared_state, :do_not_moc expect(current_settings.recaptcha_enabled).to be true expect(current_settings.login_recaptcha_protection_enabled).to be true expect(current_settings.unique_ips_limit_per_user).to eq(15) + expect(current_settings.spam_check_endpoint_enabled).to be true + expect(current_settings.spam_check_endpoint_url).to eq 'https://www.example.com/spamcheck' end end @@ -336,7 +364,7 @@ describe 'Admin updates settings', :clean_gitlab_redis_shared_state, :do_not_moc end it 'loads usage ping payload on click', :js do - allow(ActiveRecord::Base.connection).to receive(:transaction_open?).and_return(false) + stub_usage_data_connections page.within('#js-usage-settings') do expected_payload_content = /(?=.*"uuid")(?=.*"hostname")/m @@ -377,7 +405,7 @@ describe 'Admin updates settings', :clean_gitlab_redis_shared_state, :do_not_moc visit network_admin_application_settings_path page.within('.as-issue-limits') do - fill_in 'Max requests per second per user', with: 0 + fill_in 'Max requests per minute per user', with: 0 click_button 'Save changes' end |