From 1eb6189404f53ae59e4cb47ef9d5ad3a9bec3064 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Thu, 15 Mar 2012 03:21:10 +0100 Subject: Fix #5440 - multiple render_to_string breaks partials formats This fixes situation where rendering template to string sets `rendered_format` to the format rendered there. This is ok to have consistent formats rendered in partials, but it breaks on next renders if format is explicitly set or on last render where default format does not necessarily need to be the format of first rendered template. --- actionpack/test/fixtures/test/_partial_only_html.html | 1 + actionpack/test/fixtures/test/with_html_partial.html.erb | 1 + actionpack/test/fixtures/test/with_partial.html.erb | 1 + actionpack/test/fixtures/test/with_partial.text.erb | 1 + 4 files changed, 4 insertions(+) create mode 100644 actionpack/test/fixtures/test/_partial_only_html.html create mode 100644 actionpack/test/fixtures/test/with_html_partial.html.erb create mode 100644 actionpack/test/fixtures/test/with_partial.html.erb create mode 100644 actionpack/test/fixtures/test/with_partial.text.erb (limited to 'actionpack/test/fixtures') diff --git a/actionpack/test/fixtures/test/_partial_only_html.html b/actionpack/test/fixtures/test/_partial_only_html.html new file mode 100644 index 0000000000..d2d630bd40 --- /dev/null +++ b/actionpack/test/fixtures/test/_partial_only_html.html @@ -0,0 +1 @@ +only html partial \ No newline at end of file diff --git a/actionpack/test/fixtures/test/with_html_partial.html.erb b/actionpack/test/fixtures/test/with_html_partial.html.erb new file mode 100644 index 0000000000..d84d909d64 --- /dev/null +++ b/actionpack/test/fixtures/test/with_html_partial.html.erb @@ -0,0 +1 @@ +<%= render :partial => "partial_only_html" %> diff --git a/actionpack/test/fixtures/test/with_partial.html.erb b/actionpack/test/fixtures/test/with_partial.html.erb new file mode 100644 index 0000000000..7502364cf5 --- /dev/null +++ b/actionpack/test/fixtures/test/with_partial.html.erb @@ -0,0 +1 @@ +<%= render :partial => "partial_only" %> diff --git a/actionpack/test/fixtures/test/with_partial.text.erb b/actionpack/test/fixtures/test/with_partial.text.erb new file mode 100644 index 0000000000..5f068ebf27 --- /dev/null +++ b/actionpack/test/fixtures/test/with_partial.text.erb @@ -0,0 +1 @@ +**<%= render :partial => "partial_only" %>** -- cgit v1.2.3