From 1389f4b43f96cd3e0c6e932080d3087853c7eef0 Mon Sep 17 00:00:00 2001 From: George Claghorn Date: Fri, 22 Dec 2017 14:04:52 -0500 Subject: Test that cache stores build unversioned keys --- activesupport/test/cache/behaviors/cache_store_behavior.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'activesupport/test/cache/behaviors') diff --git a/activesupport/test/cache/behaviors/cache_store_behavior.rb b/activesupport/test/cache/behaviors/cache_store_behavior.rb index 73a9b2a71c..bdc689b8b4 100644 --- a/activesupport/test/cache/behaviors/cache_store_behavior.rb +++ b/activesupport/test/cache/behaviors/cache_store_behavior.rb @@ -174,6 +174,18 @@ module CacheStoreBehavior assert_equal "bar", @cache.read("foo") end + def test_unversioned_cache_key + obj = Object.new + def obj.cache_key + "foo" + end + def obj.cache_key_with_version + "foo-v1" + end + @cache.write(obj, "bar") + assert_equal "bar", @cache.read("foo") + end + def test_array_as_cache_key @cache.write([:fu, "foo"], "bar") assert_equal "bar", @cache.read("fu/foo") -- cgit v1.2.3