From 4f99a2186479d5f77460622f2c0f37708b3ec1bc Mon Sep 17 00:00:00 2001 From: George Claghorn Date: Fri, 13 Apr 2018 14:43:12 -0400 Subject: Fix rendering a differently-formatted partial after caching --- actionpack/test/controller/caching_test.rb | 8 ++++++++ .../test/fixtures/functional_caching/_formatted_partial.html.erb | 1 + .../xml_fragment_cached_with_html_partial.xml.builder | 5 +++++ 3 files changed, 14 insertions(+) create mode 100644 actionpack/test/fixtures/functional_caching/_formatted_partial.html.erb create mode 100644 actionpack/test/fixtures/functional_caching/xml_fragment_cached_with_html_partial.xml.builder (limited to 'actionpack/test') diff --git a/actionpack/test/controller/caching_test.rb b/actionpack/test/controller/caching_test.rb index 8b596083d5..a8f726f181 100644 --- a/actionpack/test/controller/caching_test.rb +++ b/actionpack/test/controller/caching_test.rb @@ -173,6 +173,9 @@ class FunctionalCachingController < CachingController end end + def xml_fragment_cached_with_html_partial + end + def formatted_fragment_cached respond_to do |format| format.html @@ -308,6 +311,11 @@ CACHED @store.read("views/functional_caching/formatted_fragment_cached_with_variant:#{template_digest("functional_caching/formatted_fragment_cached_with_variant")}/fragment") end + def test_fragment_caching_with_html_partials_in_xml + get :xml_fragment_cached_with_html_partial, format: "*/*" + assert_response :success + end + private def template_digest(name) ActionView::Digestor.digest(name: name, finder: @controller.lookup_context) diff --git a/actionpack/test/fixtures/functional_caching/_formatted_partial.html.erb b/actionpack/test/fixtures/functional_caching/_formatted_partial.html.erb new file mode 100644 index 0000000000..aad73c0d6b --- /dev/null +++ b/actionpack/test/fixtures/functional_caching/_formatted_partial.html.erb @@ -0,0 +1 @@ +

Hello!

diff --git a/actionpack/test/fixtures/functional_caching/xml_fragment_cached_with_html_partial.xml.builder b/actionpack/test/fixtures/functional_caching/xml_fragment_cached_with_html_partial.xml.builder new file mode 100644 index 0000000000..2bdda3af18 --- /dev/null +++ b/actionpack/test/fixtures/functional_caching/xml_fragment_cached_with_html_partial.xml.builder @@ -0,0 +1,5 @@ +cache do + xml.title "Hello!" +end + +xml.body cdata_section(render("formatted_partial")) -- cgit v1.2.3