From a0d49dc011304985a8fd8a7ab337c003995c8ae1 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Fri, 14 Oct 2022 12:10:40 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- spec/features/admin/admin_settings_spec.rb | 36 +++++++----------------------- 1 file changed, 8 insertions(+), 28 deletions(-) (limited to 'spec/features') diff --git a/spec/features/admin/admin_settings_spec.rb b/spec/features/admin/admin_settings_spec.rb index b2e86112d98..9e7666b920f 100644 --- a/spec/features/admin/admin_settings_spec.rb +++ b/spec/features/admin/admin_settings_spec.rb @@ -400,39 +400,19 @@ RSpec.describe 'Admin updates settings' do end context 'Runner Registration' do - context 'when feature is enabled' do - before do - stub_feature_flags(runner_registration_control: true) - end - - it 'allows admins to control who has access to register runners' do - visit ci_cd_admin_application_settings_path - - expect(current_settings.valid_runner_registrars).to eq(ApplicationSetting::VALID_RUNNER_REGISTRAR_TYPES) + it 'allows admins to control who has access to register runners' do + visit ci_cd_admin_application_settings_path - page.within('.as-runner') do - find_all('input[type="checkbox"]').each(&:click) + expect(current_settings.valid_runner_registrars).to eq(ApplicationSetting::VALID_RUNNER_REGISTRAR_TYPES) - click_button 'Save changes' - end - - expect(current_settings.valid_runner_registrars).to eq([]) - expect(page).to have_content "Application settings saved successfully" - end - end + page.within('.as-runner') do + find_all('input[type="checkbox"]').each(&:click) - context 'when feature is disabled' do - before do - stub_feature_flags(runner_registration_control: false) + click_button 'Save changes' end - it 'does not allow admins to control who has access to register runners' do - visit ci_cd_admin_application_settings_path - - expect(current_settings.valid_runner_registrars).to eq(ApplicationSetting::VALID_RUNNER_REGISTRAR_TYPES) - - expect(page).not_to have_css('.as-runner') - end + expect(current_settings.valid_runner_registrars).to eq([]) + expect(page).to have_content "Application settings saved successfully" end end -- cgit v1.2.3