diff options
Diffstat (limited to 'spec/features/admin/admin_settings_spec.rb')
-rw-r--r-- | spec/features/admin/admin_settings_spec.rb | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/spec/features/admin/admin_settings_spec.rb b/spec/features/admin/admin_settings_spec.rb index c281ba3aab9..369b258a63d 100644 --- a/spec/features/admin/admin_settings_spec.rb +++ b/spec/features/admin/admin_settings_spec.rb @@ -285,6 +285,55 @@ RSpec.describe 'Admin updates settings', :clean_gitlab_redis_shared_state, :do_n expect(current_settings.auto_devops_domain).to eq('domain.com') expect(page).to have_content "Application settings saved successfully" end + + context 'Container Registry' do + context 'delete tags service execution timeout' do + let(:feature_flag_enabled) { true } + let(:client_support) { true } + + before do + stub_container_registry_config(enabled: true) + stub_feature_flags(container_registry_expiration_policies_throttling: feature_flag_enabled) + allow(ContainerRegistry::Client).to receive(:supports_tag_delete?).and_return(client_support) + end + + RSpec.shared_examples 'not having service timeout settings' do + it 'lacks the timeout settings' do + visit ci_cd_admin_application_settings_path + + expect(page).not_to have_content "Container Registry delete tags service execution timeout" + end + end + + context 'with feature flag enabled' do + context 'with client supporting tag delete' do + it 'changes the timeout' do + visit ci_cd_admin_application_settings_path + + page.within('.as-registry') do + fill_in 'application_setting_container_registry_delete_tags_service_timeout', with: 400 + click_button 'Save changes' + end + + expect(current_settings.container_registry_delete_tags_service_timeout).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_behaves_like 'not having service timeout settings' + end + end + + context 'with feature flag disabled' do + let(:feature_flag_enabled) { false } + + it_behaves_like 'not having service timeout settings' + end + end + end end context 'Repository page' do |