Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-03 21:08:46 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-03 21:08:46 +0300
commit63a015fd85ae35634eb882d0078e65d80300816c (patch)
tree317928bc138d54e28980962e813004876398a7ac /spec/lib/gitlab/repository_cache_spec.rb
parent55693cc1ec8ac79444bc7214d2812a4ac41bf043 (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.rb12
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 }