aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorSean Griffin <sean@seantheprogrammer.com>2015-11-05 19:21:13 -0700
committerSean Griffin <sean@seantheprogrammer.com>2015-11-05 19:21:13 -0700
commitcb67c819338d75c07a591dc23759747c740a5088 (patch)
treeec86334cdbe470a29d35e6e7616994def02502d5 /activesupport/test
parent9b663e2679cfdaa2da9bfed0bd4d601309072c22 (diff)
parentb9fb0f262371a668865d0987585933add7085670 (diff)
downloadrails-cb67c819338d75c07a591dc23759747c740a5088.tar.gz
rails-cb67c819338d75c07a591dc23759747c740a5088.tar.bz2
rails-cb67c819338d75c07a591dc23759747c740a5088.zip
Merge pull request #22194 from grosser/grosser/read-nil
cache nil replies from backend cache so misses are fast too
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/caching_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/activesupport/test/caching_test.rb b/activesupport/test/caching_test.rb
index 854fcce4ef..94e73b6df3 100644
--- a/activesupport/test/caching_test.rb
+++ b/activesupport/test/caching_test.rb
@@ -625,6 +625,14 @@ module LocalCacheBehavior
end
end
+ def test_local_cache_of_read_nil
+ @cache.with_local_cache do
+ assert_equal nil, @cache.read('foo')
+ @cache.send(:bypass_local_cache) { @cache.write 'foo', 'bar' }
+ assert_equal nil, @cache.read('foo')
+ end
+ end
+
def test_local_cache_of_write_nil
@cache.with_local_cache do
assert @cache.write('foo', nil)