diff options
Diffstat (limited to 'spec/features/projects/settings/registry_settings_spec.rb')
-rw-r--r-- | spec/features/projects/settings/registry_settings_spec.rb | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/spec/features/projects/settings/registry_settings_spec.rb b/spec/features/projects/settings/registry_settings_spec.rb index 509729d526d..ff28d59ed08 100644 --- a/spec/features/projects/settings/registry_settings_spec.rb +++ b/spec/features/projects/settings/registry_settings_spec.rb @@ -3,8 +3,6 @@ require 'spec_helper' RSpec.describe 'Project > Settings > CI/CD > Container registry tag expiration policy', :js do - using RSpec::Parameterized::TableSyntax - let_it_be(:user) { create(:user) } let_it_be(:project, reload: true) { create(:project, namespace: user.namespace) } @@ -63,31 +61,34 @@ RSpec.describe 'Project > Settings > CI/CD > Container registry tag expiration p end context 'with a project without expiration policy' do - where(:application_setting, :feature_flag, :result) do - true | true | :available_section - true | false | :available_section - false | true | :available_section - false | false | :disabled_message + before do + project.container_expiration_policy.destroy! + end + + context 'with container_expiration_policies_enable_historic_entries enabled' do + before do + stub_application_setting(container_expiration_policies_enable_historic_entries: true) + end + + it 'displays the related section' do + subject + + within '[data-testid="registry-settings-app"]' do + expect(find('[data-testid="enable-toggle"]')).to have_content('Disabled - Tags will not be automatically deleted.') + end + end end - with_them do + context 'with container_expiration_policies_enable_historic_entries disabled' do before do - project.container_expiration_policy.destroy! - stub_feature_flags(container_expiration_policies_historic_entry: false) - stub_application_setting(container_expiration_policies_enable_historic_entries: application_setting) - stub_feature_flags(container_expiration_policies_historic_entry: project) if feature_flag + stub_application_setting(container_expiration_policies_enable_historic_entries: false) end - it 'displays the expected result' do + it 'does not display the related section' do subject within '[data-testid="registry-settings-app"]' do - case result - when :available_section - expect(find('[data-testid="enable-toggle"]')).to have_content('Disabled - Tags will not be automatically deleted.') - when :disabled_message - expect(find('.gl-alert-title')).to have_content('Cleanup policy for tags is disabled') - end + expect(find('.gl-alert-title')).to have_content('Cleanup policy for tags is disabled') end end end |