diff options
Diffstat (limited to 'spec/features/admin')
30 files changed, 63 insertions, 35 deletions
diff --git a/spec/features/admin/admin_abuse_reports_spec.rb b/spec/features/admin/admin_abuse_reports_spec.rb index 93051a8a355..845e186dd5b 100644 --- a/spec/features/admin/admin_abuse_reports_spec.rb +++ b/spec/features/admin/admin_abuse_reports_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe "Admin::AbuseReports", :js do +RSpec.describe "Admin::AbuseReports", :js do let(:user) { create(:user) } context 'as an admin' do diff --git a/spec/features/admin/admin_appearance_spec.rb b/spec/features/admin/admin_appearance_spec.rb index e711ee7d40e..48aaec6e6df 100644 --- a/spec/features/admin/admin_appearance_spec.rb +++ b/spec/features/admin/admin_appearance_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Admin Appearance' do +RSpec.describe 'Admin Appearance' do let!(:appearance) { create(:appearance) } it 'Create new appearance' do diff --git a/spec/features/admin/admin_broadcast_messages_spec.rb b/spec/features/admin/admin_broadcast_messages_spec.rb index bf7f8563e68..091ed0a3396 100644 --- a/spec/features/admin/admin_broadcast_messages_spec.rb +++ b/spec/features/admin/admin_broadcast_messages_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Admin Broadcast Messages' do +RSpec.describe 'Admin Broadcast Messages' do before do sign_in(create(:admin)) create(:broadcast_message, :expired, message: 'Migration to new server') diff --git a/spec/features/admin/admin_browse_spam_logs_spec.rb b/spec/features/admin/admin_browse_spam_logs_spec.rb index c79524a7fb3..65847876c11 100644 --- a/spec/features/admin/admin_browse_spam_logs_spec.rb +++ b/spec/features/admin/admin_browse_spam_logs_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Admin browse spam logs' do +RSpec.describe 'Admin browse spam logs' do let!(:spam_log) { create(:spam_log, description: 'abcde ' * 20) } before do diff --git a/spec/features/admin/admin_builds_spec.rb b/spec/features/admin/admin_builds_spec.rb index afdf8eb0cca..85f0c44ed9c 100644 --- a/spec/features/admin/admin_builds_spec.rb +++ b/spec/features/admin/admin_builds_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Admin Builds' do +RSpec.describe 'Admin Builds' do before do sign_in(create(:admin)) end diff --git a/spec/features/admin/admin_disables_git_access_protocol_spec.rb b/spec/features/admin/admin_disables_git_access_protocol_spec.rb index 05ebb7e90d2..d7feb21a8b3 100644 --- a/spec/features/admin/admin_disables_git_access_protocol_spec.rb +++ b/spec/features/admin/admin_disables_git_access_protocol_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Admin disables Git access protocol', :js do +RSpec.describe 'Admin disables Git access protocol', :js do include StubENV include MobileHelpers diff --git a/spec/features/admin/admin_disables_two_factor_spec.rb b/spec/features/admin/admin_disables_two_factor_spec.rb index 7227141168e..216c8ae36c7 100644 --- a/spec/features/admin/admin_disables_two_factor_spec.rb +++ b/spec/features/admin/admin_disables_two_factor_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Admin disables 2FA for a user' do +RSpec.describe 'Admin disables 2FA for a user' do it 'successfully', :js do sign_in(create(:admin)) user = create(:user, :two_factor) diff --git a/spec/features/admin/admin_groups_spec.rb b/spec/features/admin/admin_groups_spec.rb index 1d82650d11d..9cd335ffb8c 100644 --- a/spec/features/admin/admin_groups_spec.rb +++ b/spec/features/admin/admin_groups_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Admin Groups' do +RSpec.describe 'Admin Groups' do include Select2Helper let(:internal) { Gitlab::VisibilityLevel::INTERNAL } @@ -181,7 +181,7 @@ describe 'Admin Groups' do end end - describe 'admin remove himself from a group', :js do + describe 'admin remove themself from a group', :js, quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/222342' do it 'removes admin from the group' do group.add_user(current_user, Gitlab::Access::DEVELOPER) diff --git a/spec/features/admin/admin_health_check_spec.rb b/spec/features/admin/admin_health_check_spec.rb index 9ce96fe8020..dfc7f5f6f84 100644 --- a/spec/features/admin/admin_health_check_spec.rb +++ b/spec/features/admin/admin_health_check_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe "Admin Health Check", :feature do +RSpec.describe "Admin Health Check", :feature do include StubENV let_it_be(:admin) { create(:admin) } diff --git a/spec/features/admin/admin_hook_logs_spec.rb b/spec/features/admin/admin_hook_logs_spec.rb index 98900142353..f4a70621cee 100644 --- a/spec/features/admin/admin_hook_logs_spec.rb +++ b/spec/features/admin/admin_hook_logs_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Admin::HookLogs' do +RSpec.describe 'Admin::HookLogs' do let(:project) { create(:project) } let(:system_hook) { create(:system_hook) } let(:hook_log) { create(:web_hook_log, web_hook: system_hook, internal_error_message: 'some error') } diff --git a/spec/features/admin/admin_hooks_spec.rb b/spec/features/admin/admin_hooks_spec.rb index 40bcf4a31e4..1c14d65a1cd 100644 --- a/spec/features/admin/admin_hooks_spec.rb +++ b/spec/features/admin/admin_hooks_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Admin::Hooks' do +RSpec.describe 'Admin::Hooks' do let(:user) { create(:admin) } before do diff --git a/spec/features/admin/admin_mode/login_spec.rb b/spec/features/admin/admin_mode/login_spec.rb index afc6f2ddb56..4b26ceb55e2 100644 --- a/spec/features/admin/admin_mode/login_spec.rb +++ b/spec/features/admin/admin_mode/login_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Admin Mode Login', :clean_gitlab_redis_shared_state, :do_not_mock_admin_mode do +RSpec.describe 'Admin Mode Login', :clean_gitlab_redis_shared_state, :do_not_mock_admin_mode do include TermsHelper include UserLoginHelper include LdapHelpers diff --git a/spec/features/admin/admin_mode/logout_spec.rb b/spec/features/admin/admin_mode/logout_spec.rb index e1b4aba5724..b4d49fe760f 100644 --- a/spec/features/admin/admin_mode/logout_spec.rb +++ b/spec/features/admin/admin_mode/logout_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Admin Mode Logout', :js, :clean_gitlab_redis_shared_state, :do_not_mock_admin_mode do +RSpec.describe 'Admin Mode Logout', :js, :clean_gitlab_redis_shared_state, :do_not_mock_admin_mode do include TermsHelper include UserLoginHelper diff --git a/spec/features/admin/admin_mode/workers_spec.rb b/spec/features/admin/admin_mode/workers_spec.rb index 0ca61e6c193..d037f5555dc 100644 --- a/spec/features/admin/admin_mode/workers_spec.rb +++ b/spec/features/admin/admin_mode/workers_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' # Test an operation that triggers background jobs requiring administrative rights -describe 'Admin mode for workers', :do_not_mock_admin_mode, :request_store, :clean_gitlab_redis_shared_state do +RSpec.describe 'Admin mode for workers', :do_not_mock_admin_mode, :request_store, :clean_gitlab_redis_shared_state do let(:user) { create(:user) } let(:user_to_delete) { create(:user) } diff --git a/spec/features/admin/admin_mode_spec.rb b/spec/features/admin/admin_mode_spec.rb index f642d614a5d..3b4edbc1a07 100644 --- a/spec/features/admin/admin_mode_spec.rb +++ b/spec/features/admin/admin_mode_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Admin mode', :clean_gitlab_redis_shared_state, :do_not_mock_admin_mode do +RSpec.describe 'Admin mode', :clean_gitlab_redis_shared_state, :do_not_mock_admin_mode do include MobileHelpers include StubENV diff --git a/spec/features/admin/admin_projects_spec.rb b/spec/features/admin/admin_projects_spec.rb index d1889d3a89a..cbaa18509ba 100644 --- a/spec/features/admin/admin_projects_spec.rb +++ b/spec/features/admin/admin_projects_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe "Admin::Projects" do +RSpec.describe "Admin::Projects" do include Select2Helper let(:user) { create :user } diff --git a/spec/features/admin/admin_requests_profiles_spec.rb b/spec/features/admin/admin_requests_profiles_spec.rb index e93c0ff8b20..c649fdd8e19 100644 --- a/spec/features/admin/admin_requests_profiles_spec.rb +++ b/spec/features/admin/admin_requests_profiles_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Admin::RequestsProfilesController' do +RSpec.describe 'Admin::RequestsProfilesController' do let(:tmpdir) { Dir.mktmpdir('profiler-test') } before do diff --git a/spec/features/admin/admin_runners_spec.rb b/spec/features/admin/admin_runners_spec.rb index ca2fd2f2e9e..0e20ccf6bec 100644 --- a/spec/features/admin/admin_runners_spec.rb +++ b/spec/features/admin/admin_runners_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe "Admin Runners" do +RSpec.describe "Admin Runners" do include StubENV include FilteredSearchHelpers include SortingHelper diff --git a/spec/features/admin/admin_sees_project_statistics_spec.rb b/spec/features/admin/admin_sees_project_statistics_spec.rb index ecd0aab925b..6e8211a9b4e 100644 --- a/spec/features/admin/admin_sees_project_statistics_spec.rb +++ b/spec/features/admin/admin_sees_project_statistics_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe "Admin > Admin sees project statistics" do +RSpec.describe "Admin > Admin sees project statistics" do let(:current_user) { create(:admin) } before do diff --git a/spec/features/admin/admin_sees_projects_statistics_spec.rb b/spec/features/admin/admin_sees_projects_statistics_spec.rb index 6a6f369ac7c..786fa98255c 100644 --- a/spec/features/admin/admin_sees_projects_statistics_spec.rb +++ b/spec/features/admin/admin_sees_projects_statistics_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe "Admin > Admin sees projects statistics" do +RSpec.describe "Admin > Admin sees projects statistics" do let(:current_user) { create(:admin) } before do diff --git a/spec/features/admin/admin_serverless_domains_spec.rb b/spec/features/admin/admin_serverless_domains_spec.rb index 48f6af8d4bd..256887f425f 100644 --- a/spec/features/admin/admin_serverless_domains_spec.rb +++ b/spec/features/admin/admin_serverless_domains_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Admin Serverless Domains', :js do +RSpec.describe 'Admin Serverless Domains', :js do let(:sample_domain) { build(:pages_domain) } before do 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 diff --git a/spec/features/admin/admin_system_info_spec.rb b/spec/features/admin/admin_system_info_spec.rb index 3dacf63e25a..6a0448fd890 100644 --- a/spec/features/admin/admin_system_info_spec.rb +++ b/spec/features/admin/admin_system_info_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Admin System Info' do +RSpec.describe 'Admin System Info' do before do sign_in(create(:admin)) end diff --git a/spec/features/admin/admin_users_impersonation_tokens_spec.rb b/spec/features/admin/admin_users_impersonation_tokens_spec.rb index b9de858e3b9..ec3dd322f97 100644 --- a/spec/features/admin/admin_users_impersonation_tokens_spec.rb +++ b/spec/features/admin/admin_users_impersonation_tokens_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Admin > Users > Impersonation Tokens', :js do +RSpec.describe 'Admin > Users > Impersonation Tokens', :js do let(:admin) { create(:admin) } let!(:user) { create(:user) } diff --git a/spec/features/admin/admin_users_spec.rb b/spec/features/admin/admin_users_spec.rb index 0c8cd895c00..369f91c6faa 100644 --- a/spec/features/admin/admin_users_spec.rb +++ b/spec/features/admin/admin_users_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe "Admin::Users" do +RSpec.describe "Admin::Users" do include Spec::Support::Helpers::Features::ResponsiveTableHelpers let!(:user) do diff --git a/spec/features/admin/admin_uses_repository_checks_spec.rb b/spec/features/admin/admin_uses_repository_checks_spec.rb index 954773e766d..b8851c28531 100644 --- a/spec/features/admin/admin_uses_repository_checks_spec.rb +++ b/spec/features/admin/admin_uses_repository_checks_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Admin uses repository checks', :request_store, :clean_gitlab_redis_shared_state, :do_not_mock_admin_mode do +RSpec.describe 'Admin uses repository checks', :request_store, :clean_gitlab_redis_shared_state, :do_not_mock_admin_mode do include StubENV let(:admin) { create(:admin) } diff --git a/spec/features/admin/clusters/applications_spec.rb b/spec/features/admin/clusters/applications_spec.rb index 8310811b43d..3bcadfdbfc1 100644 --- a/spec/features/admin/clusters/applications_spec.rb +++ b/spec/features/admin/clusters/applications_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_relative '../../../../spec/features/clusters/installing_applications_shared_examples' -describe 'Instance-level Cluster Applications', :js do +RSpec.describe 'Instance-level Cluster Applications', :js do include GoogleApi::CloudPlatformHelpers let(:user) { create(:admin) } diff --git a/spec/features/admin/clusters/eks_spec.rb b/spec/features/admin/clusters/eks_spec.rb index 40561aa508c..ef49aebc7c5 100644 --- a/spec/features/admin/clusters/eks_spec.rb +++ b/spec/features/admin/clusters/eks_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Instance-level AWS EKS Cluster', :js do +RSpec.describe 'Instance-level AWS EKS Cluster', :js do let(:user) { create(:admin) } before do diff --git a/spec/features/admin/dashboard_spec.rb b/spec/features/admin/dashboard_spec.rb index 018ef13cbb6..4ffa5e3be0b 100644 --- a/spec/features/admin/dashboard_spec.rb +++ b/spec/features/admin/dashboard_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'admin visits dashboard' do +RSpec.describe 'admin visits dashboard' do include ProjectForksHelper before do diff --git a/spec/features/admin/services/admin_activates_prometheus_spec.rb b/spec/features/admin/services/admin_activates_prometheus_spec.rb index 64c57cd425b..35af9dd6c68 100644 --- a/spec/features/admin/services/admin_activates_prometheus_spec.rb +++ b/spec/features/admin/services/admin_activates_prometheus_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Admin activates Prometheus' do +RSpec.describe 'Admin activates Prometheus', :js do let(:admin) { create(:user, :admin) } before do |