diff options
author | fatkodima <fatkodima123@gmail.com> | 2018-02-05 00:35:17 +0200 |
---|---|---|
committer | Jeremy Daer <jeremydaer@gmail.com> | 2018-02-04 17:16:27 -0800 |
commit | 08aa8afd24e65525757c6cb9ef2af60b5984c6ac (patch) | |
tree | f3b15dc88afe2ac6398004994604d10e5c35007d /activesupport/test | |
parent | 5d1999547d81edb07c0ce9149023b1bcd5de8a57 (diff) | |
download | rails-08aa8afd24e65525757c6cb9ef2af60b5984c6ac.tar.gz rails-08aa8afd24e65525757c6cb9ef2af60b5984c6ac.tar.bz2 rails-08aa8afd24e65525757c6cb9ef2af60b5984c6ac.zip |
RedisCacheStore: fix `#write_multi` mset serialization
Closes #31886
Fixes #31884
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/cache/behaviors/cache_store_behavior.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/activesupport/test/cache/behaviors/cache_store_behavior.rb b/activesupport/test/cache/behaviors/cache_store_behavior.rb index ac37ab6e61..efb57d34a2 100644 --- a/activesupport/test/cache/behaviors/cache_store_behavior.rb +++ b/activesupport/test/cache/behaviors/cache_store_behavior.rb @@ -113,6 +113,16 @@ module CacheStoreBehavior assert_equal("fufu", @cache.read("fu")) end + def test_fetch_multi_without_expires_in + @cache.write("foo", "bar") + @cache.write("fud", "biz") + + values = @cache.fetch_multi("foo", "fu", "fud", expires_in: nil) { |value| value * 2 } + + assert_equal({ "foo" => "bar", "fu" => "fufu", "fud" => "biz" }, values) + assert_equal("fufu", @cache.read("fu")) + end + def test_multi_with_objects cache_struct = Struct.new(:cache_key, :title) foo = cache_struct.new("foo", "FOO!") |