Commit ab23d70d authored by James Lopez's avatar James Lopez

Merge branch 'ensure-feature-flag-that-is-used-is-covered-by-specs' into 'master'

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

See merge request gitlab-org/gitlab!52487
parents 12ce091a 7a69c103
......@@ -32,6 +32,20 @@ RSpec.describe FetchSubscriptionPlansService do
execute_service
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
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