Commit 7a69c103 authored by Ragnar Hardarson's avatar Ragnar Hardarson Committed by James Lopez

Ensure we get a new cache key if we toggle feature flag

parent 55e8d950
...@@ -32,6 +32,20 @@ RSpec.describe FetchSubscriptionPlansService do ...@@ -32,6 +32,20 @@ RSpec.describe FetchSubscriptionPlansService do
execute_service execute_service
end end
context 'with pnp_subscription_plan_cache_key flag disabled' do
before do
stub_feature_flags(pnp_subscription_plan_cache_key: false, subscription_plan_cache_key: true)
end
it 'returns a new cache key so the cache is busted' do
allow(Gitlab::HTTP).to receive(:get).and_return(response_mock)
expect(Rails.cache).to receive(:read).with("subscription-plan-#{plan}")
execute_service
end
end
context 'with given namespace_id' do context 'with given namespace_id' do
subject(:execute_service) { described_class.new(plan: plan, namespace_id: namespace_id).execute } subject(:execute_service) { described_class.new(plan: plan, namespace_id: namespace_id).execute }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment