diff options
author | George Claghorn <george@basecamp.com> | 2017-12-22 14:04:52 -0500 |
---|---|---|
committer | George Claghorn <george@basecamp.com> | 2017-12-22 14:05:12 -0500 |
commit | 1389f4b43f96cd3e0c6e932080d3087853c7eef0 (patch) | |
tree | dc7f7488818cdc725a2f17467036651785c093ae /activesupport/test/cache/behaviors | |
parent | f6d2efa9e8d597832510fd20e3b8fee87f6e6df6 (diff) | |
download | rails-1389f4b43f96cd3e0c6e932080d3087853c7eef0.tar.gz rails-1389f4b43f96cd3e0c6e932080d3087853c7eef0.tar.bz2 rails-1389f4b43f96cd3e0c6e932080d3087853c7eef0.zip |
Test that cache stores build unversioned keys
Diffstat (limited to 'activesupport/test/cache/behaviors')
-rw-r--r-- | activesupport/test/cache/behaviors/cache_store_behavior.rb | 12 |
1 files changed, 12 insertions, 0 deletions
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") |