aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/caching_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/test/caching_test.rb')
-rw-r--r--activesupport/test/caching_test.rb15
1 files changed, 13 insertions, 2 deletions
diff --git a/activesupport/test/caching_test.rb b/activesupport/test/caching_test.rb
index 5c844b8122..8871b1b0e9 100644
--- a/activesupport/test/caching_test.rb
+++ b/activesupport/test/caching_test.rb
@@ -42,7 +42,7 @@ class CacheKeyTest < ActiveSupport::TestCase
end
end
- def test_respond_to_cache_key
+ def test_expand_cache_key_respond_to_cache_key
key = 'foo'
def key.cache_key
:foo_key
@@ -50,7 +50,7 @@ class CacheKeyTest < ActiveSupport::TestCase
assert_equal 'foo_key', ActiveSupport::Cache.expand_cache_key(key)
end
- def test_array_with_something_that_responds_to_cache_key
+ def test_expand_cache_key_array_with_something_that_responds_to_cache_key
key = 'foo'
def key.cache_key
:foo_key
@@ -58,6 +58,17 @@ class CacheKeyTest < ActiveSupport::TestCase
assert_equal 'foo_key', ActiveSupport::Cache.expand_cache_key([key])
end
+ def test_expand_cache_key_of_nil
+ assert_equal '', ActiveSupport::Cache.expand_cache_key(nil)
+ end
+
+ def test_expand_cache_key_of_false
+ assert_equal 'false', ActiveSupport::Cache.expand_cache_key(false)
+ end
+
+ def test_expand_cache_key_of_true
+ assert_equal 'true', ActiveSupport::Cache.expand_cache_key(true)
+ end
end
class CacheStoreSettingTest < ActiveSupport::TestCase