2020-11-24 15:15:51 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
RSpec.describe ContainerRegistryHelper do
|
|
|
|
using RSpec::Parameterized::TableSyntax
|
|
|
|
|
2021-03-11 19:13:27 +05:30
|
|
|
describe '#container_registry_expiration_policies_throttling?' do
|
|
|
|
subject { helper.container_registry_expiration_policies_throttling? }
|
2020-11-24 15:15:51 +05:30
|
|
|
|
|
|
|
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
|