diff options
author | Krekoten' Marjan <krekoten@gmail.com> | 2010-09-22 23:17:49 +0300 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-09-25 11:04:20 +0200 |
commit | 8639c10a40604cee2f3d412470c2960712fdc809 (patch) | |
tree | d24959945486950eb948f81c1aa5b2ccbfaffa17 /actionpack/test | |
parent | da94d0e8ca03209610a01f1be8d056319befe571 (diff) | |
download | rails-8639c10a40604cee2f3d412470c2960712fdc809.tar.gz rails-8639c10a40604cee2f3d412470c2960712fdc809.tar.bz2 rails-8639c10a40604cee2f3d412470c2960712fdc809.zip |
Fix logging when cache key contains % sign [#5570 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/log_subscriber_test.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/actionpack/test/controller/log_subscriber_test.rb b/actionpack/test/controller/log_subscriber_test.rb index 414eec4f9d..7f7246d15c 100644 --- a/actionpack/test/controller/log_subscriber_test.rb +++ b/actionpack/test/controller/log_subscriber_test.rb @@ -23,6 +23,10 @@ module Another def with_fragment_cache render :inline => "<%= cache('foo'){ 'bar' } %>" end + + def with_fragment_cache_and_percent_in_key + render :inline => "<%= cache('foo%bar'){ 'Contains % sign in key' } %>" + end def with_page_cache cache_page("Super soaker", "/index.html") @@ -140,6 +144,18 @@ class ACLogSubscriberTest < ActionController::TestCase ensure @controller.config.perform_caching = true end + + def test_with_fragment_cache_and_percent_in_key + @controller.config.perform_caching = true + get :with_fragment_cache_and_percent_in_key + wait + + assert_equal 4, logs.size + assert_match /Exist fragment\? views\/foo%bar/, logs[1] + assert_match /Write fragment views\/foo%bar/, logs[2] + ensure + @controller.config.perform_caching = true + end def test_with_page_cache @controller.config.perform_caching = true |