diff options
author | Thong Kuah <tkuah@gitlab.com> | 2019-06-18 23:00:55 +0000 |
---|---|---|
committer | Thong Kuah <tkuah@gitlab.com> | 2019-06-18 23:00:55 +0000 |
commit | 133dc87501d003f64c7f186c3988c79bf861557d (patch) | |
tree | fc51cfd32eb80cac27f7cb0fb8095a53041db4c1 /spec | |
parent | 5ee6771c60fd36081bf95f4f577a3406197a61b9 (diff) | |
parent | 1b0c71ef8423cf20532953e58735dd7f61325e85 (diff) | |
download | gitlab-ce-133dc87501d003f64c7f186c3988c79bf861557d.tar.gz |
Merge branch 'sh-cache-feature-flag-names' into 'master'
Cache feature flag names in Redis for a minute
Closes #63435
See merge request gitlab-org/gitlab-ce!29816
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/feature_spec.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/spec/lib/feature_spec.rb b/spec/lib/feature_spec.rb index a7163048370..6f05914f915 100644 --- a/spec/lib/feature_spec.rb +++ b/spec/lib/feature_spec.rb @@ -31,7 +31,8 @@ describe Feature do expect(described_class.persisted_names).to be_empty end - it 'caches the feature names when request store is active', :request_store do + it 'caches the feature names when request store is active', + :request_store, :use_clean_rails_memory_store_caching do Feature::FlipperFeature.create!(key: 'foo') expect(Feature::FlipperFeature) @@ -39,6 +40,12 @@ describe Feature do .once .and_call_original + expect(Rails.cache) + .to receive(:fetch) + .once + .with('flipper:persisted_names', expires_in: 1.minute) + .and_call_original + 2.times do expect(described_class.persisted_names).to eq(%w[foo]) end |