diff options
Diffstat (limited to 'spec/helpers/container_registry_helper_spec.rb')
-rw-r--r-- | spec/helpers/container_registry_helper_spec.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/helpers/container_registry_helper_spec.rb b/spec/helpers/container_registry_helper_spec.rb new file mode 100644 index 00000000000..6e6e8137b3e --- /dev/null +++ b/spec/helpers/container_registry_helper_spec.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe ContainerRegistryHelper do + using RSpec::Parameterized::TableSyntax + + describe '#limit_delete_tags_service?' do + subject { helper.limit_delete_tags_service? } + + where(:feature_flag_enabled, :client_support, :expected_result) do + true | true | true + true | false | false + false | true | false + false | false | false + end + + with_them do + before do + stub_feature_flags(container_registry_expiration_policies_throttling: feature_flag_enabled) + allow(ContainerRegistry::Client).to receive(:supports_tag_delete?).and_return(client_support) + end + + it { is_expected.to eq(expected_result) } + end + end +end |