summaryrefslogtreecommitdiff
path: root/spec/helpers/container_expiration_policies_helper_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-10-21 07:08:36 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-10-21 07:08:36 +0000
commit48aff82709769b098321c738f3444b9bdaa694c6 (patch)
treee00c7c43e2d9b603a5a6af576b1685e400410dee /spec/helpers/container_expiration_policies_helper_spec.rb
parent879f5329ee916a948223f8f43d77fba4da6cd028 (diff)
downloadgitlab-ce-4d844e2fbf8315eaf3fddb9a0b241a909be3ecbf.tar.gz
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42
Diffstat (limited to 'spec/helpers/container_expiration_policies_helper_spec.rb')
-rw-r--r--spec/helpers/container_expiration_policies_helper_spec.rb25
1 files changed, 25 insertions, 0 deletions
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