diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-18 23:02:30 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-18 23:02:30 +0300 |
commit | 41fe97390ceddf945f3d967b8fdb3de4c66b7dea (patch) | |
tree | 9c8d89a8624828992f06d892cd2f43818ff5dcc8 /spec/features/admin | |
parent | 0804d2dc31052fb45a1efecedc8e06ce9bc32862 (diff) |
Add latest changes from gitlab-org/gitlab@14-9-stable-eev14.9.0-rc42
Diffstat (limited to 'spec/features/admin')
-rw-r--r-- | spec/features/admin/admin_appearance_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/admin/admin_broadcast_messages_spec.rb | 27 | ||||
-rw-r--r-- | spec/features/admin/admin_deploy_keys_spec.rb | 6 | ||||
-rw-r--r-- | spec/features/admin/admin_groups_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/admin/admin_hook_logs_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/admin/admin_hooks_spec.rb | 10 | ||||
-rw-r--r-- | spec/features/admin/admin_mode/login_spec.rb | 14 | ||||
-rw-r--r-- | spec/features/admin/admin_mode/logout_spec.rb | 4 | ||||
-rw-r--r-- | spec/features/admin/admin_projects_spec.rb | 34 | ||||
-rw-r--r-- | spec/features/admin/admin_runners_spec.rb | 10 | ||||
-rw-r--r-- | spec/features/admin/admin_sees_background_migrations_spec.rb | 8 | ||||
-rw-r--r-- | spec/features/admin/admin_settings_spec.rb | 67 | ||||
-rw-r--r-- | spec/features/admin/admin_users_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/admin/admin_uses_repository_checks_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/admin/clusters/eks_spec.rb | 6 | ||||
-rw-r--r-- | spec/features/admin/users/user_spec.rb | 10 | ||||
-rw-r--r-- | spec/features/admin/users/users_spec.rb | 12 |
17 files changed, 123 insertions, 95 deletions
diff --git a/spec/features/admin/admin_appearance_spec.rb b/spec/features/admin/admin_appearance_spec.rb index 0785c736cfb..8bf8ef56353 100644 --- a/spec/features/admin/admin_appearance_spec.rb +++ b/spec/features/admin/admin_appearance_spec.rb @@ -17,7 +17,7 @@ RSpec.describe 'Admin Appearance' do fill_in 'appearance_profile_image_guidelines', with: 'Custom profile image guidelines' click_button 'Update appearance settings' - expect(current_path).to eq admin_application_settings_appearances_path + expect(page).to have_current_path admin_application_settings_appearances_path, ignore_query: true expect(page).to have_content 'Appearance' expect(page).to have_field('appearance_title', with: 'MyCompany') diff --git a/spec/features/admin/admin_broadcast_messages_spec.rb b/spec/features/admin/admin_broadcast_messages_spec.rb index 476dd4469bc..e40f4c4678c 100644 --- a/spec/features/admin/admin_broadcast_messages_spec.rb +++ b/spec/features/admin/admin_broadcast_messages_spec.rb @@ -7,7 +7,12 @@ RSpec.describe 'Admin Broadcast Messages' do admin = create(:admin) sign_in(admin) gitlab_enable_admin_mode_sign_in(admin) - create(:broadcast_message, :expired, message: 'Migration to new server') + create( + :broadcast_message, + :expired, + message: 'Migration to new server', + target_access_levels: [Gitlab::Access::DEVELOPER] + ) visit admin_broadcast_messages_path end @@ -21,10 +26,13 @@ RSpec.describe 'Admin Broadcast Messages' do fill_in 'broadcast_message_target_path', with: '*/user_onboarded' fill_in 'broadcast_message_font', with: '#b94a48' select Date.today.next_year.year, from: 'broadcast_message_ends_at_1i' + check 'Guest' + check 'Owner' click_button 'Add broadcast message' - expect(current_path).to eq admin_broadcast_messages_path + expect(page).to have_current_path admin_broadcast_messages_path, ignore_query: true expect(page).to have_content 'Application update from 4:00 CST to 5:00 CST' + expect(page).to have_content 'Guest, Owner' expect(page).to have_content '*/user_onboarded' expect(page).to have_selector 'strong', text: '4:00 CST to 5:00 CST' expect(page).to have_selector %(div[style="background-color: #f2dede; color: #b94a48"]) @@ -35,10 +43,14 @@ RSpec.describe 'Admin Broadcast Messages' do fill_in 'broadcast_message_target_path', with: '*/user_onboarded' select 'Notification', from: 'broadcast_message_broadcast_type' select Date.today.next_year.year, from: 'broadcast_message_ends_at_1i' + check 'Reporter' + check 'Developer' + check 'Maintainer' click_button 'Add broadcast message' - expect(current_path).to eq admin_broadcast_messages_path + expect(page).to have_current_path admin_broadcast_messages_path, ignore_query: true expect(page).to have_content 'Application update from 4:00 CST to 5:00 CST' + expect(page).to have_content 'Reporter, Developer, Maintainer' expect(page).to have_content '*/user_onboarded' expect(page).to have_content 'Notification' expect(page).to have_selector 'strong', text: '4:00 CST to 5:00 CST' @@ -47,16 +59,21 @@ RSpec.describe 'Admin Broadcast Messages' do it 'edit an existing broadcast message' do click_link 'Edit' fill_in 'broadcast_message_message', with: 'Application update RIGHT NOW' + check 'Reporter' click_button 'Update broadcast message' - expect(current_path).to eq admin_broadcast_messages_path + expect(page).to have_current_path admin_broadcast_messages_path, ignore_query: true expect(page).to have_content 'Application update RIGHT NOW' + + page.within('.table-responsive') do + expect(page).to have_content 'Reporter, Developer' + end end it 'remove an existing broadcast message' do click_link 'Remove' - expect(current_path).to eq admin_broadcast_messages_path + expect(page).to have_current_path admin_broadcast_messages_path, ignore_query: true expect(page).not_to have_content 'Migration to new server' end diff --git a/spec/features/admin/admin_deploy_keys_spec.rb b/spec/features/admin/admin_deploy_keys_spec.rb index 88b8fcd8d5e..56b8c7fce14 100644 --- a/spec/features/admin/admin_deploy_keys_spec.rb +++ b/spec/features/admin/admin_deploy_keys_spec.rb @@ -47,7 +47,7 @@ RSpec.describe 'admin deploy keys', :js do fill_in 'deploy_key_key', with: new_ssh_key click_button 'Create' - expect(current_path).to eq admin_deploy_keys_path + expect(page).to have_current_path admin_deploy_keys_path, ignore_query: true page.within(find('[data-testid="deploy-keys-list"]', match: :first)) do expect(page).to have_content('laptop') @@ -67,7 +67,7 @@ RSpec.describe 'admin deploy keys', :js do fill_in 'deploy_key_title', with: 'new-title' click_button 'Save changes' - expect(current_path).to eq admin_deploy_keys_path + expect(page).to have_current_path admin_deploy_keys_path, ignore_query: true page.within(find('[data-testid="deploy-keys-list"]', match: :first)) do expect(page).to have_content('new-title') @@ -87,7 +87,7 @@ RSpec.describe 'admin deploy keys', :js do end end - expect(current_path).to eq admin_deploy_keys_path + expect(page).to have_current_path admin_deploy_keys_path, ignore_query: true page.within(find('[data-testid="deploy-keys-list"]', match: :first)) do expect(page).not_to have_content(deploy_key.title) end diff --git a/spec/features/admin/admin_groups_spec.rb b/spec/features/admin/admin_groups_spec.rb index a0a41061d64..3b3289a8487 100644 --- a/spec/features/admin/admin_groups_spec.rb +++ b/spec/features/admin/admin_groups_spec.rb @@ -58,7 +58,7 @@ RSpec.describe 'Admin Groups' do fill_in 'group_admin_note_attributes_note', with: group_admin_note click_button "Create group" - expect(current_path).to eq admin_group_path(Group.find_by(path: path_component)) + expect(page).to have_current_path admin_group_path(Group.find_by(path: path_component)), ignore_query: true content = page.find('#content-body') h3_texts = content.all('h3').collect(&:text).join("\n") expect(h3_texts).to match group_name diff --git a/spec/features/admin/admin_hook_logs_spec.rb b/spec/features/admin/admin_hook_logs_spec.rb index 837cab49bd4..fd51fd71fea 100644 --- a/spec/features/admin/admin_hook_logs_spec.rb +++ b/spec/features/admin/admin_hook_logs_spec.rb @@ -39,6 +39,6 @@ RSpec.describe 'Admin::HookLogs' do click_link 'View details' click_link 'Resend Request' - expect(current_path).to eq(edit_admin_hook_path(system_hook)) + expect(page).to have_current_path(edit_admin_hook_path(system_hook), ignore_query: true) end end diff --git a/spec/features/admin/admin_hooks_spec.rb b/spec/features/admin/admin_hooks_spec.rb index 32e4d18227e..388ab02d8e8 100644 --- a/spec/features/admin/admin_hooks_spec.rb +++ b/spec/features/admin/admin_hooks_spec.rb @@ -18,7 +18,7 @@ RSpec.describe 'Admin::Hooks' do click_on 'System Hooks', match: :first end - expect(current_path).to eq(admin_hooks_path) + expect(page).to have_current_path(admin_hooks_path, ignore_query: true) end it 'has hooks list' do @@ -49,7 +49,7 @@ RSpec.describe 'Admin::Hooks' do expect { click_button 'Add system hook' }.to change(SystemHook, :count).by(1) expect(page).to have_content 'SSL Verification: enabled' - expect(current_path).to eq(admin_hooks_path) + expect(page).to have_current_path(admin_hooks_path, ignore_query: true) expect(page).to have_content(url) end end @@ -70,7 +70,7 @@ RSpec.describe 'Admin::Hooks' do click_button 'Save changes' expect(page).to have_content 'SSL Verification: enabled' - expect(current_path).to eq(admin_hooks_path) + expect(page).to have_current_path(admin_hooks_path, ignore_query: true) expect(page).to have_content(new_url) end end @@ -111,7 +111,7 @@ RSpec.describe 'Admin::Hooks' do click_link 'Push events' end - it { expect(current_path).to eq(admin_hooks_path) } + it { expect(page).to have_current_path(admin_hooks_path, ignore_query: true) } end context 'Merge request hook' do @@ -126,7 +126,7 @@ RSpec.describe 'Admin::Hooks' do check 'Merge request events' expect { click_button 'Add system hook' }.to change(SystemHook, :count).by(1) - expect(current_path).to eq(admin_hooks_path) + expect(page).to have_current_path(admin_hooks_path, ignore_query: true) expect(page).to have_content(url) end end diff --git a/spec/features/admin/admin_mode/login_spec.rb b/spec/features/admin/admin_mode/login_spec.rb index c8ee6c14499..659f66a67d2 100644 --- a/spec/features/admin/admin_mode/login_spec.rb +++ b/spec/features/admin/admin_mode/login_spec.rb @@ -30,7 +30,7 @@ RSpec.describe 'Admin Mode Login' do enter_code(repeated_otp) - expect(current_path).to eq admin_session_path + expect(page).to have_current_path admin_session_path, ignore_query: true expect(page).to have_content('Invalid two-factor code') end @@ -51,7 +51,7 @@ RSpec.describe 'Admin Mode Login' do travel_to(30.seconds.from_now) do enter_code(user.current_otp) - expect(current_path).to eq admin_root_path + expect(page).to have_current_path admin_root_path, ignore_query: true expect(page).to have_content('Admin mode enabled') end end @@ -74,7 +74,7 @@ RSpec.describe 'Admin Mode Login' do enter_code(user.current_otp) - expect(current_path).to eq admin_root_path + expect(page).to have_current_path admin_root_path, ignore_query: true expect(page).to have_content('Admin mode enabled') end end @@ -93,7 +93,7 @@ RSpec.describe 'Admin Mode Login' do it 'allows login' do enter_code(codes.sample) - expect(current_path).to eq admin_root_path + expect(page).to have_current_path admin_root_path, ignore_query: true expect(page).to have_content('Admin mode enabled') end @@ -146,7 +146,7 @@ RSpec.describe 'Admin Mode Login' do enable_admin_mode_using_saml! expect(page).not_to have_content('Two-Factor Authentication') - expect(current_path).to eq admin_root_path + expect(page).to have_current_path admin_root_path, ignore_query: true expect(page).to have_content('Admin mode enabled') end end @@ -166,7 +166,7 @@ RSpec.describe 'Admin Mode Login' do travel_to(30.seconds.from_now) do enter_code(user.current_otp) - expect(current_path).to eq admin_root_path + expect(page).to have_current_path admin_root_path, ignore_query: true expect(page).to have_content('Admin mode enabled') end end @@ -218,7 +218,7 @@ RSpec.describe 'Admin Mode Login' do travel_to(30.seconds.from_now) do enter_code(user.current_otp) - expect(current_path).to eq admin_root_path + expect(page).to have_current_path admin_root_path, ignore_query: true expect(page).to have_content('Admin mode enabled') end end diff --git a/spec/features/admin/admin_mode/logout_spec.rb b/spec/features/admin/admin_mode/logout_spec.rb index f2f6e26fbee..3ca66ef0d6a 100644 --- a/spec/features/admin/admin_mode/logout_spec.rb +++ b/spec/features/admin/admin_mode/logout_spec.rb @@ -20,7 +20,7 @@ RSpec.describe 'Admin Mode Logout', :js do it 'disable removes admin mode and redirects to root page' do gitlab_disable_admin_mode - expect(current_path).to eq root_path + expect(page).to have_current_path root_path, ignore_query: true open_top_nav @@ -43,7 +43,7 @@ RSpec.describe 'Admin Mode Logout', :js do it 'disable removes admin mode and redirects to root page' do gitlab_disable_admin_mode - expect(current_path).to eq root_path + expect(page).to have_current_path root_path, ignore_query: true open_top_nav diff --git a/spec/features/admin/admin_projects_spec.rb b/spec/features/admin/admin_projects_spec.rb index 8938bab60d7..b0737377de0 100644 --- a/spec/features/admin/admin_projects_spec.rb +++ b/spec/features/admin/admin_projects_spec.rb @@ -5,7 +5,6 @@ require 'spec_helper' RSpec.describe "Admin::Projects" do include Spec::Support::Helpers::Features::MembersHelpers include Spec::Support::Helpers::Features::InviteMembersModalHelper - include Select2Helper include Spec::Support::Helpers::ModalHelpers let(:user) { create :user } @@ -26,7 +25,7 @@ RSpec.describe "Admin::Projects" do end it "is ok" do - expect(current_path).to eq(admin_projects_path) + expect(page).to have_current_path(admin_projects_path, ignore_query: true) end it 'renders projects list without archived project' do @@ -63,7 +62,7 @@ RSpec.describe "Admin::Projects" do end it "has project info" do - expect(current_path).to eq admin_project_path(project) + expect(page).to have_current_path admin_project_path(project), ignore_query: true expect(page).to have_content(project.path) expect(page).to have_content(project.name) expect(page).to have_content(project.full_name) @@ -117,18 +116,6 @@ RSpec.describe "Admin::Projects" do expect(find_member_row(current_user)).to have_content('Developer') end - - context 'with the invite_members_group_modal feature flag disabled' do - it 'adds admin to the project as developer' do - stub_feature_flags(invite_members_group_modal: false) - - visit project_project_members_path(project) - - add_member_using_form(current_user.id, role: 'Developer') - - expect(find_member_row(current_user)).to have_content('Developer') - end - end end describe 'admin removes themselves from the project', :js do @@ -150,22 +137,7 @@ RSpec.describe "Admin::Projects" do click_button('Leave') end - expect(current_path).to match dashboard_projects_path - end - end - - # temporary method for the form until the :invite_members_group_modal feature flag is - # enabled: https://gitlab.com/gitlab-org/gitlab/-/issues/247208 - def add_member_using_form(id, role: 'Developer') - page.within '.invite-users-form' do - select2(id, from: '#user_ids', multiple: true) - - fill_in 'expires_at', with: 5.days.from_now.to_date - find_field('expires_at').native.send_keys :enter - - select(role, from: "access_level") - - click_on 'Invite' + expect(page).to have_current_path(dashboard_projects_path, ignore_query: true, url: false) end end end diff --git a/spec/features/admin/admin_runners_spec.rb b/spec/features/admin/admin_runners_spec.rb index 25ff4022454..3f0c7e64a1f 100644 --- a/spec/features/admin/admin_runners_spec.rb +++ b/spec/features/admin/admin_runners_spec.rb @@ -11,6 +11,8 @@ RSpec.describe "Admin Runners" do admin = create(:admin) sign_in(admin) gitlab_enable_admin_mode_sign_in(admin) + + wait_for_requests end describe "Runners page", :js do @@ -21,7 +23,7 @@ RSpec.describe "Admin Runners" do context "when there are runners" do it 'has all necessary texts' do - create(:ci_runner, :instance, created_at: 1.year.ago, contacted_at: Time.now) + create(:ci_runner, :instance, created_at: 1.year.ago, contacted_at: Time.zone.now) create(:ci_runner, :instance, created_at: 1.year.ago, contacted_at: 1.week.ago) create(:ci_runner, :instance, created_at: 1.year.ago, contacted_at: 1.year.ago) @@ -156,9 +158,9 @@ RSpec.describe "Admin Runners" do let!(:never_contacted) { create(:ci_runner, :instance, description: 'runner-never-contacted', contacted_at: nil) } before do - create(:ci_runner, :instance, description: 'runner-1', contacted_at: Time.now) - create(:ci_runner, :instance, description: 'runner-2', contacted_at: Time.now) - create(:ci_runner, :instance, description: 'runner-paused', active: false, contacted_at: Time.now) + create(:ci_runner, :instance, description: 'runner-1', contacted_at: Time.zone.now) + create(:ci_runner, :instance, description: 'runner-2', contacted_at: Time.zone.now) + create(:ci_runner, :instance, description: 'runner-paused', active: false, contacted_at: Time.zone.now) visit admin_runners_path end diff --git a/spec/features/admin/admin_sees_background_migrations_spec.rb b/spec/features/admin/admin_sees_background_migrations_spec.rb index a3d0c7bdd4d..d05a09a79ef 100644 --- a/spec/features/admin/admin_sees_background_migrations_spec.rb +++ b/spec/features/admin/admin_sees_background_migrations_spec.rb @@ -56,7 +56,13 @@ RSpec.describe "Admin > Admin sees background migrations" do context 'when there are failed migrations' do before do allow_next_instance_of(Gitlab::BackgroundMigration::BatchingStrategies::PrimaryKeyBatchingStrategy) do |batch_class| - allow(batch_class).to receive(:next_batch).with(anything, anything, batch_min_value: 6, batch_size: 5).and_return([6, 10]) + allow(batch_class).to receive(:next_batch).with( + anything, + anything, + batch_min_value: 6, + batch_size: 5, + job_arguments: failed_migration.job_arguments + ).and_return([6, 10]) end end diff --git a/spec/features/admin/admin_settings_spec.rb b/spec/features/admin/admin_settings_spec.rb index ca452264c02..df93bd773a6 100644 --- a/spec/features/admin/admin_settings_spec.rb +++ b/spec/features/admin/admin_settings_spec.rb @@ -373,7 +373,8 @@ RSpec.describe 'Admin updates settings' do { container_registry_delete_tags_service_timeout: 'Container Registry delete tags service execution timeout', container_registry_expiration_policies_worker_capacity: 'Cleanup policy maximum workers running concurrently', - container_registry_cleanup_tags_service_max_list_size: 'Cleanup policy maximum number of tags to be deleted' + container_registry_cleanup_tags_service_max_list_size: 'Cleanup policy maximum number of tags to be deleted', + container_registry_expiration_policies_caching: 'Enable container expiration caching' } end @@ -393,26 +394,16 @@ RSpec.describe 'Admin updates settings' do %i[container_registry_delete_tags_service_timeout container_registry_expiration_policies_worker_capacity container_registry_cleanup_tags_service_max_list_size].each do |setting| context "for container registry setting #{setting}" do - context 'with feature flag enabled' do - context 'with client supporting tag delete' do - it 'changes the setting' do - visit ci_cd_admin_application_settings_path - - page.within('.as-registry') do - fill_in "application_setting_#{setting}", with: 400 - click_button 'Save changes' - end - - expect(current_settings.public_send(setting)).to eq(400) - expect(page).to have_content "Application settings saved successfully" - end - end - - context 'with client not supporting tag delete' do - let(:client_support) { false } + it 'changes the setting' do + visit ci_cd_admin_application_settings_path - it_behaves_like 'not having container registry setting', setting + page.within('.as-registry') do + fill_in "application_setting_#{setting}", with: 400 + click_button 'Save changes' end + + expect(current_settings.public_send(setting)).to eq(400) + expect(page).to have_content "Application settings saved successfully" end context 'with feature flag disabled' do @@ -422,6 +413,28 @@ RSpec.describe 'Admin updates settings' do end end end + + context 'for container registry setting container_registry_expiration_policies_caching' do + it 'updates container_registry_expiration_policies_caching' do + old_value = current_settings.container_registry_expiration_policies_caching + + visit ci_cd_admin_application_settings_path + + page.within('.as-registry') do + find('#application_setting_container_registry_expiration_policies_caching.form-check-input').click + click_button 'Save changes' + end + + expect(current_settings.container_registry_expiration_policies_caching).to eq(!old_value) + expect(page).to have_content "Application settings saved successfully" + end + + context 'with feature flag disabled' do + let(:feature_flag_enabled) { false } + + it_behaves_like 'not having container registry setting', :container_registry_expiration_policies_caching + end + end end end @@ -694,6 +707,20 @@ RSpec.describe 'Admin updates settings' do include_examples 'regular throttle rate limit settings' end + + it 'changes search rate limits' do + visit network_admin_application_settings_path + + page.within('.as-search-limits') do + fill_in 'Maximum number of requests per minute for an authenticated user', with: 98 + fill_in 'Maximum number of requests per minute for an unauthenticated IP address', with: 76 + click_button 'Save changes' + end + + expect(page).to have_content "Application settings saved successfully" + expect(current_settings.search_rate_limit).to eq(98) + expect(current_settings.search_rate_limit_unauthenticated).to eq(76) + end end context 'Preferences page' do @@ -838,7 +865,7 @@ RSpec.describe 'Admin updates settings' do end it 'loads admin settings page without redirect for reauthentication' do - expect(current_path).to eq general_admin_application_settings_path + expect(page).to have_current_path general_admin_application_settings_path, ignore_query: true end end diff --git a/spec/features/admin/admin_users_spec.rb b/spec/features/admin/admin_users_spec.rb index 95e3f5c70e5..f4b7fa45e4f 100644 --- a/spec/features/admin/admin_users_spec.rb +++ b/spec/features/admin/admin_users_spec.rb @@ -54,7 +54,7 @@ RSpec.describe "Admin::Users" do visit admin_users_path(tab: 'cohorts') - expect(page).to have_content("#{Time.now.strftime('%b %Y')} 3 0") + expect(page).to have_content("#{Time.zone.now.strftime('%b %Y')} 3 0") end end diff --git a/spec/features/admin/admin_uses_repository_checks_spec.rb b/spec/features/admin/admin_uses_repository_checks_spec.rb index c13313609b5..4e6aae7c46f 100644 --- a/spec/features/admin/admin_uses_repository_checks_spec.rb +++ b/spec/features/admin/admin_uses_repository_checks_spec.rb @@ -43,7 +43,7 @@ RSpec.describe 'Admin uses repository checks', :request_store do project = create(:project) project.update_columns( last_repository_check_failed: true, - last_repository_check_at: Time.now + last_repository_check_at: Time.zone.now ) visit_admin_project_page(project) diff --git a/spec/features/admin/clusters/eks_spec.rb b/spec/features/admin/clusters/eks_spec.rb index bb2678de2ae..71d2bba73b1 100644 --- a/spec/features/admin/clusters/eks_spec.rb +++ b/spec/features/admin/clusters/eks_spec.rb @@ -8,13 +8,15 @@ RSpec.describe 'Instance-level AWS EKS Cluster', :js do before do sign_in(user) gitlab_enable_admin_mode_sign_in(user) + stub_application_setting(eks_integration_enabled: true) end context 'when user does not have a cluster and visits group clusters page' do before do visit admin_clusters_path - click_link 'Connect with a certificate' + click_button 'Actions' + click_link 'Create a new cluster' end context 'when user creates a cluster on AWS EKS' do @@ -23,7 +25,7 @@ RSpec.describe 'Instance-level AWS EKS Cluster', :js do end it 'user sees a form to create an EKS cluster' do - expect(page).to have_content('Create new cluster on EKS') + expect(page).to have_content('Authenticate with Amazon Web Services') end end end diff --git a/spec/features/admin/users/user_spec.rb b/spec/features/admin/users/user_spec.rb index 0d053329627..7e8dee9cc0b 100644 --- a/spec/features/admin/users/user_spec.rb +++ b/spec/features/admin/users/user_spec.rb @@ -220,13 +220,13 @@ RSpec.describe 'Admin::Users::User' do context 'a user with an expired password' do before do - another_user.update!(password_expires_at: Time.now - 5.minutes) + another_user.update!(password_expires_at: Time.zone.now - 5.minutes) end it 'does not redirect to password change page' do subject - expect(current_path).to eq('/') + expect(page).to have_current_path('/') end end end @@ -250,18 +250,18 @@ RSpec.describe 'Admin::Users::User' do it 'is redirected back to the impersonated users page in the admin after stopping' do subject - expect(current_path).to eq("/admin/users/#{another_user.username}") + expect(page).to have_current_path("/admin/users/#{another_user.username}", ignore_query: true) end context 'a user with an expired password' do before do - another_user.update!(password_expires_at: Time.now - 5.minutes) + another_user.update!(password_expires_at: Time.zone.now - 5.minutes) end it 'is redirected back to the impersonated users page in the admin after stopping' do subject - expect(current_path).to eq("/admin/users/#{another_user.username}") + expect(page).to have_current_path("/admin/users/#{another_user.username}", ignore_query: true) end end end diff --git a/spec/features/admin/users/users_spec.rb b/spec/features/admin/users/users_spec.rb index 5b0b6e085c9..4d9a7f31911 100644 --- a/spec/features/admin/users/users_spec.rb +++ b/spec/features/admin/users/users_spec.rb @@ -21,7 +21,7 @@ RSpec.describe 'Admin::Users' do end it "is ok" do - expect(current_path).to eq(admin_users_path) + expect(page).to have_current_path(admin_users_path, ignore_query: true) end it "has users list" do @@ -132,7 +132,7 @@ RSpec.describe 'Admin::Users' do end it 'searches with respect of sorting' do - visit admin_users_path(sort: 'Name') + visit admin_users_path(sort: 'name_asc') fill_in :search_query, with: 'Foo' click_button('Search users') @@ -338,6 +338,8 @@ RSpec.describe 'Admin::Users' do end it 'displays count of the users authorized groups' do + visit admin_users_path + wait_for_requests expect(page.find("[data-testid='user-group-count-#{current_user.id}']").text).to eq("2") @@ -574,7 +576,7 @@ RSpec.describe 'Admin::Users' do user.reload expect(user.name).to eq('Big Bang') expect(user.admin?).to be_truthy - expect(user.password_expires_at).to be <= Time.now + expect(user.password_expires_at).to be <= Time.zone.now end end @@ -602,8 +604,8 @@ RSpec.describe 'Admin::Users' do def sort_by(option) page.within('.filtered-search-block') do - find('.dropdown-menu-toggle').click - click_link option + find('.gl-new-dropdown').click + find('.gl-new-dropdown-item', text: option).click end end end |