2020-09-02 05:10:23 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
RSpec.describe ContainerRegistryHelper do
|
|
|
|
using RSpec::Parameterized::TableSyntax
|
|
|
|
|
2021-02-01 10:08:56 -05:00
|
|
|
describe '#container_registry_expiration_policies_throttling?' do
|
|
|
|
subject { helper.container_registry_expiration_policies_throttling? }
|
2020-09-02 05:10:23 -04:00
|
|
|
|
|
|
|
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
|