From 48aff82709769b098321c738f3444b9bdaa694c6 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 21 Oct 2020 07:08:36 +0000 Subject: Add latest changes from gitlab-org/gitlab@13-5-stable-ee --- .../container_expiration_policies_helper_spec.rb | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'spec/helpers/container_expiration_policies_helper_spec.rb') diff --git a/spec/helpers/container_expiration_policies_helper_spec.rb b/spec/helpers/container_expiration_policies_helper_spec.rb index b2a03f8d90f..7ad3804e3a9 100644 --- a/spec/helpers/container_expiration_policies_helper_spec.rb +++ b/spec/helpers/container_expiration_policies_helper_spec.rb @@ -3,6 +3,8 @@ require 'spec_helper' RSpec.describe ContainerExpirationPoliciesHelper do + using RSpec::Parameterized::TableSyntax + describe '#keep_n_options' do it 'returns keep_n options formatted for dropdown usage' do expected_result = [ @@ -44,4 +46,27 @@ RSpec.describe ContainerExpirationPoliciesHelper do expect(helper.older_than_options).to eq(expected_result) end end + + describe '#container_expiration_policies_historic_entry_enabled?' do + let_it_be(:project) { build_stubbed(:project) } + + subject { helper.container_expiration_policies_historic_entry_enabled?(project) } + + where(:application_setting, :feature_flag, :expected_result) do + true | true | true + true | false | true + false | true | true + false | false | false + end + + with_them do + before do + 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 + end + + it { is_expected.to eq(expected_result) } + end + end end -- cgit v1.2.1