diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
commit | 6ed4ec3e0b1340f96b7c043ef51d1b33bbe85fde (patch) | |
tree | dc4d20fe6064752c0bd323187252c77e0a89144b /spec/features/admin/admin_mode/workers_spec.rb | |
parent | 9868dae7fc0655bd7ce4a6887d4e6d487690eeed (diff) |
Add latest changes from gitlab-org/gitlab@15-4-stable-eev15.4.0-rc42
Diffstat (limited to 'spec/features/admin/admin_mode/workers_spec.rb')
-rw-r--r-- | spec/features/admin/admin_mode/workers_spec.rb | 54 |
1 files changed, 42 insertions, 12 deletions
diff --git a/spec/features/admin/admin_mode/workers_spec.rb b/spec/features/admin/admin_mode/workers_spec.rb index 0caa883fb5b..12f5e20e176 100644 --- a/spec/features/admin/admin_mode/workers_spec.rb +++ b/spec/features/admin/admin_mode/workers_spec.rb @@ -37,26 +37,56 @@ RSpec.describe 'Admin mode for workers', :request_store do gitlab_enable_admin_mode_sign_in(user) end - it 'can delete user', :js do - visit admin_user_path(user_to_delete) + context 'when user_destroy_with_limited_execution_time_worker is enabled' do + it 'can delete user', :js do + visit admin_user_path(user_to_delete) + + click_action_in_user_dropdown(user_to_delete.id, 'Delete user') + + page.within '.modal-dialog' do + find("input[name='username']").send_keys(user_to_delete.name) + click_button 'Delete user' + + wait_for_requests + end - click_action_in_user_dropdown(user_to_delete.id, 'Delete user') + expect(page).to have_content('The user is being deleted.') - page.within '.modal-dialog' do - find("input[name='username']").send_keys(user_to_delete.name) - click_button 'Delete user' + # Perform jobs while logged out so that admin mode is only enabled in job metadata + execute_jobs_signed_out(user) + + visit admin_user_path(user_to_delete) + + expect(find('h1.page-title')).to have_content('(Blocked)') + end + end - wait_for_requests + context 'when user_destroy_with_limited_execution_time_worker is disabled' do + before do + stub_feature_flags(user_destroy_with_limited_execution_time_worker: false) end - expect(page).to have_content('The user is being deleted.') + it 'can delete user', :js do + visit admin_user_path(user_to_delete) - # Perform jobs while logged out so that admin mode is only enabled in job metadata - execute_jobs_signed_out(user) + click_action_in_user_dropdown(user_to_delete.id, 'Delete user') - visit admin_user_path(user_to_delete) + page.within '.modal-dialog' do + find("input[name='username']").send_keys(user_to_delete.name) + click_button 'Delete user' + + wait_for_requests + end + + expect(page).to have_content('The user is being deleted.') - expect(page).to have_title('Not Found') + # Perform jobs while logged out so that admin mode is only enabled in job metadata + execute_jobs_signed_out(user) + + visit admin_user_path(user_to_delete) + + expect(page).to have_title('Not Found') + end end end end |