diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-03 21:08:46 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-03 21:08:46 +0300 |
commit | 63a015fd85ae35634eb882d0078e65d80300816c (patch) | |
tree | 317928bc138d54e28980962e813004876398a7ac /spec/lib/gitlab/repository_cache_spec.rb | |
parent | 55693cc1ec8ac79444bc7214d2812a4ac41bf043 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/repository_cache_spec.rb')
-rw-r--r-- | spec/lib/gitlab/repository_cache_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/lib/gitlab/repository_cache_spec.rb b/spec/lib/gitlab/repository_cache_spec.rb index 1b7dd1766da..e787288fc51 100644 --- a/spec/lib/gitlab/repository_cache_spec.rb +++ b/spec/lib/gitlab/repository_cache_spec.rb @@ -50,6 +50,18 @@ describe Gitlab::RepositoryCache do end end + describe '#write' do + it 'writes the given key and value to the cache' do + cache.write(:test, 'test') + expect(backend).to have_received(:write).with("test:#{namespace}", 'test') + end + + it 'passes additional options to the backend' do + cache.write(:test, 'test', expires_in: 10.minutes) + expect(backend).to have_received(:write).with("test:#{namespace}", 'test', expires_in: 10.minutes) + end + end + describe '#fetch_without_caching_false', :use_clean_rails_memory_store_caching do let(:key) { :foo } let(:backend) { Rails.cache } |