aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/caching_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/controller/caching_test.rb')
-rw-r--r--actionpack/test/controller/caching_test.rb21
1 files changed, 16 insertions, 5 deletions
diff --git a/actionpack/test/controller/caching_test.rb b/actionpack/test/controller/caching_test.rb
index 0efba5b77f..2c3511f6a0 100644
--- a/actionpack/test/controller/caching_test.rb
+++ b/actionpack/test/controller/caching_test.rb
@@ -854,14 +854,17 @@ Ciao
CACHED
assert_equal expected_body, @response.body
- assert_equal "This bit's fragment cached", @store.read('views/test.host/functional_caching/fragment_cached')
+ assert_equal "This bit's fragment cached",
+ @store.read("views/test.host/functional_caching/fragment_cached/#{template_digest("functional_caching/fragment_cached", "html")}")
end
def test_fragment_caching_in_partials
get :html_fragment_cached_with_partial
assert_response :success
assert_match(/Old fragment caching in a partial/, @response.body)
- assert_match("Old fragment caching in a partial", @store.read('views/test.host/functional_caching/html_fragment_cached_with_partial'))
+
+ assert_match("Old fragment caching in a partial",
+ @store.read("views/test.host/functional_caching/html_fragment_cached_with_partial/#{template_digest("functional_caching/_partial", "html")}"))
end
def test_render_inline_before_fragment_caching
@@ -869,7 +872,8 @@ CACHED
assert_response :success
assert_match(/Some inline content/, @response.body)
assert_match(/Some cached content/, @response.body)
- assert_match("Some cached content", @store.read('views/test.host/functional_caching/inline_fragment_cached'))
+ assert_match("Some cached content",
+ @store.read("views/test.host/functional_caching/inline_fragment_cached/#{template_digest("functional_caching/inline_fragment_cached", "html")}"))
end
def test_html_formatted_fragment_caching
@@ -879,7 +883,8 @@ CACHED
assert_equal expected_body, @response.body
- assert_equal "<p>ERB</p>", @store.read('views/test.host/functional_caching/formatted_fragment_cached')
+ assert_equal "<p>ERB</p>",
+ @store.read("views/test.host/functional_caching/formatted_fragment_cached/#{template_digest("functional_caching/formatted_fragment_cached", "html")}")
end
def test_xml_formatted_fragment_caching
@@ -889,8 +894,14 @@ CACHED
assert_equal expected_body, @response.body
- assert_equal " <p>Builder</p>\n", @store.read('views/test.host/functional_caching/formatted_fragment_cached')
+ assert_equal " <p>Builder</p>\n",
+ @store.read("views/test.host/functional_caching/formatted_fragment_cached/#{template_digest("functional_caching/formatted_fragment_cached", "xml")}")
end
+
+ private
+ def template_digest(name, format)
+ ActionView::Digestor.digest(name, format, @controller.lookup_context)
+ end
end
class CacheHelperOutputBufferTest < ActionController::TestCase