Welcome to mirror list, hosted at ThFree Co, Russian Federation.

container_registry_helper_spec.rb « helpers « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 49e56113dd8c72c5e644d4fdaf8c2e8c497979c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe ContainerRegistryHelper do
  using RSpec::Parameterized::TableSyntax

  describe '#container_registry_expiration_policies_throttling?' do
    subject { helper.container_registry_expiration_policies_throttling? }

    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