diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2010-03-14 18:55:13 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2010-03-14 19:09:32 -0700 |
commit | 16572fd46e189d80c6be7d499e687fe129053a2c (patch) | |
tree | 69d053f8fecbf5eb9c558f6aec2c2b84c08220d3 /actionpack/test | |
parent | 95bd56e3cc028971059ac4ec0dfe3e29012ef35d (diff) | |
download | rails-16572fd46e189d80c6be7d499e687fe129053a2c.tar.gz rails-16572fd46e189d80c6be7d499e687fe129053a2c.tar.bz2 rails-16572fd46e189d80c6be7d499e687fe129053a2c.zip |
read_ and write_fragment cache preserve html safety yet cache strings only
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/caching_test.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/actionpack/test/controller/caching_test.rb b/actionpack/test/controller/caching_test.rb index a3c8fdbb6e..a792752ef4 100644 --- a/actionpack/test/controller/caching_test.rb +++ b/actionpack/test/controller/caching_test.rb @@ -634,6 +634,19 @@ class FragmentCachingTest < ActionController::TestCase assert_equal 'generated till now -> fragment content', buffer end + def test_html_safety + assert_nil @store.read('views/name') + content = 'value'.html_safe + assert_equal content, @controller.write_fragment('name', content) + + cached = @store.read('views/name') + assert_equal content, cached + assert_equal String, cached.class + + html_safe = @controller.read_fragment('name') + assert_equal content, html_safe + assert html_safe.html_safe? + end end class FunctionalCachingController < CachingController |