@@ -12,10 +12,10 @@ def test_expand_cache_key_with_rails_cache_id
1212 begin
1313 ENV [ 'RAILS_CACHE_ID' ] = 'c99'
1414 assert_equal 'c99/foo' , ActiveSupport ::Cache . expand_cache_key ( :foo )
15- assert_equal 'c99/foo' , ActiveSupport ::Cache . expand_cache_key ( [ :foo ] )
15+ assert_equal 'c99/c99/ foo' , ActiveSupport ::Cache . expand_cache_key ( [ :foo ] )
1616 assert_equal 'c99/c99/foo/c99/bar' , ActiveSupport ::Cache . expand_cache_key ( [ :foo , :bar ] )
1717 assert_equal 'nm/c99/foo' , ActiveSupport ::Cache . expand_cache_key ( :foo , :nm )
18- assert_equal 'nm/c99/foo' , ActiveSupport ::Cache . expand_cache_key ( [ :foo ] , :nm )
18+ assert_equal 'nm/c99/c99/ foo' , ActiveSupport ::Cache . expand_cache_key ( [ :foo ] , :nm )
1919 assert_equal 'nm/c99/c99/foo/c99/bar' , ActiveSupport ::Cache . expand_cache_key ( [ :foo , :bar ] , :nm )
2020 ensure
2121 ENV [ 'RAILS_CACHE_ID' ] = nil
@@ -50,6 +50,14 @@ def key.cache_key
5050 assert_equal 'foo_key' , ActiveSupport ::Cache . expand_cache_key ( key )
5151 end
5252
53+ def test_array_with_something_that_responds_to_cache_key
54+ key = 'foo'
55+ def key . cache_key
56+ :foo_key
57+ end
58+ assert_equal 'foo_key' , ActiveSupport ::Cache . expand_cache_key ( [ key ] )
59+ end
60+
5361end
5462
5563class CacheStoreSettingTest < ActiveSupport ::TestCase
0 commit comments