diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 13:00:54 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 13:00:54 +0300 |
commit | 3cccd102ba543e02725d247893729e5c73b38295 (patch) | |
tree | f36a04ec38517f5deaaacb5acc7d949688d1e187 /spec/lib/container_registry/migration_spec.rb | |
parent | 205943281328046ef7b4528031b90fbda70c75ac (diff) |
Add latest changes from gitlab-org/gitlab@14-10-stable-eev14.10.0-rc42
Diffstat (limited to 'spec/lib/container_registry/migration_spec.rb')
-rw-r--r-- | spec/lib/container_registry/migration_spec.rb | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/spec/lib/container_registry/migration_spec.rb b/spec/lib/container_registry/migration_spec.rb index ffbbfb249e3..6c0fc94e27f 100644 --- a/spec/lib/container_registry/migration_spec.rb +++ b/spec/lib/container_registry/migration_spec.rb @@ -37,8 +37,8 @@ RSpec.describe ContainerRegistry::Migration do subject { described_class.enqueue_waiting_time } where(:slow_enabled, :fast_enabled, :expected_result) do - false | false | 1.hour - true | false | 6.hours + false | false | 45.minutes + true | false | 165.minutes false | true | 0 true | true | 0 end @@ -154,15 +154,35 @@ RSpec.describe ContainerRegistry::Migration do end end - describe '.target_plan' do - let_it_be(:plan) { create(:plan) } + describe '.target_plans' do + subject { described_class.target_plans } - before do - stub_application_setting(container_registry_import_target_plan: plan.name) + where(:target_plan, :result) do + 'free' | described_class::FREE_TIERS + 'premium' | described_class::PREMIUM_TIERS + 'ultimate' | described_class::ULTIMATE_TIERS end - it 'returns the matching application_setting' do - expect(described_class.target_plan).to eq(plan) + with_them do + before do + stub_application_setting(container_registry_import_target_plan: target_plan) + end + + it { is_expected.to eq(result) } + end + end + + describe '.all_plans?' do + subject { described_class.all_plans? } + + it { is_expected.to eq(true) } + + context 'feature flag disabled' do + before do + stub_feature_flags(container_registry_migration_phase2_all_plans: false) + end + + it { is_expected.to eq(false) } end end end |