diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2018-03-22 19:09:21 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-22 19:09:21 -0400 |
commit | 57e145387ba57602afb0907f2a3897d37089dc4e (patch) | |
tree | 3a1cf8763c4fd700e2bc53a7d348be61e7cb9bfd /activesupport/test | |
parent | e26424a74092ba278c7744bbccdbc97a080693cc (diff) | |
parent | 4e13a364a67e02ed0b3b8f69bac84d69632f58f6 (diff) | |
download | rails-57e145387ba57602afb0907f2a3897d37089dc4e.tar.gz rails-57e145387ba57602afb0907f2a3897d37089dc4e.tar.bz2 rails-57e145387ba57602afb0907f2a3897d37089dc4e.zip |
Merge pull request #32315 from huacnlee/fix/local-cache-read-multi-entry-return
Fix Cache `read_multi` with local_cache bug, should returns raw value, not `ActiveSupport::Cache::Entry` instance.
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/cache/behaviors/local_cache_behavior.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/activesupport/test/cache/behaviors/local_cache_behavior.rb b/activesupport/test/cache/behaviors/local_cache_behavior.rb index 363f2d1084..baa38ba6ac 100644 --- a/activesupport/test/cache/behaviors/local_cache_behavior.rb +++ b/activesupport/test/cache/behaviors/local_cache_behavior.rb @@ -129,6 +129,18 @@ module LocalCacheBehavior end end + def test_local_cache_of_read_multi + @cache.with_local_cache do + @cache.write("foo", "foo", raw: true) + @cache.write("bar", "bar", raw: true) + values = @cache.read_multi("foo", "bar") + assert_equal "foo", @cache.read("foo") + assert_equal "bar", @cache.read("bar") + assert_equal "foo", values["foo"] + assert_equal "bar", values["bar"] + end + end + def test_middleware app = lambda { |env| result = @cache.write("foo", "bar") |