diff options
author | Neeraj Singh <neerajdotname@gmail.com> | 2010-07-27 21:41:11 +0800 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-07-28 21:02:44 +0800 |
commit | 3265af5c8b98da0d9f292fcc2feddc2da02e652d (patch) | |
tree | ebb706cc7ee2864314bb500dce9bb4bfbdc93f06 /activesupport | |
parent | 194ec3d165f6ef4dd53391d6c959c57ed60507b4 (diff) | |
download | rails-3265af5c8b98da0d9f292fcc2feddc2da02e652d.tar.gz rails-3265af5c8b98da0d9f292fcc2feddc2da02e652d.tar.bz2 rails-3265af5c8b98da0d9f292fcc2feddc2da02e652d.zip |
adding more test cases for expand_cache_key
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/test/caching_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/activesupport/test/caching_test.rb b/activesupport/test/caching_test.rb index 212c1f82a8..ed9b53f593 100644 --- a/activesupport/test/caching_test.rb +++ b/activesupport/test/caching_test.rb @@ -7,6 +7,16 @@ class CacheKeyTest < ActiveSupport::TestCase assert_equal '1/2/true', ActiveSupport::Cache.expand_cache_key([1, '2', true]) assert_equal 'name/1/2/true', ActiveSupport::Cache.expand_cache_key([1, '2', true], :name) end + + def test_expand_cache_key_with_rails_cache_id + ENV['RAILS_CACHE_ID'] = 'c99' + assert_equal 'c99/foo', ActiveSupport::Cache.expand_cache_key(:foo) + assert_equal 'c99/foo', ActiveSupport::Cache.expand_cache_key([:foo]) + assert_equal 'c99/c99/foo/c99/bar', ActiveSupport::Cache.expand_cache_key([:foo, :bar]) + assert_equal 'nm/c99/foo', ActiveSupport::Cache.expand_cache_key(:foo, :nm) + assert_equal 'nm/c99/foo', ActiveSupport::Cache.expand_cache_key([:foo], :nm) + assert_equal 'nm/c99/c99/foo/c99/bar', ActiveSupport::Cache.expand_cache_key([:foo, :bar], :nm) + end end class CacheStoreSettingTest < ActiveSupport::TestCase |