Skip to content
This repository
Browse code

Add missing test for #5308

  • Loading branch information...
commit 7130f9159146776067d334b5043b789860b92761 1 parent 1eb6189
Piotr Sarnacki authored
13  actionpack/test/controller/render_test.rb
@@ -560,6 +560,12 @@ def render_to_string_and_render_with_different_formats
560 560
     render :template => "test/with_partial", :formats => [:text]
561 561
   end
562 562
 
  563
+  def render_template_within_a_template_with_other_format
  564
+    render  :template => "test/with_xml_template",
  565
+            :formats  => [:html],
  566
+            :layout   => "with_html_partial"
  567
+  end
  568
+
563 569
   def partial_with_counter
564 570
     render :partial => "counter", :locals => { :counter_counter => 5 }
565 571
   end
@@ -1289,6 +1295,13 @@ def test_render_to_string_and_render_with_different_formats
1289 1295
     assert_equal "text/plain", @response.content_type
1290 1296
   end
1291 1297
 
  1298
+  def test_render_template_within_a_template_with_other_format
  1299
+    get :render_template_within_a_template_with_other_format
  1300
+    expected = "only html partial<p>This is grand!</p>"
  1301
+    assert_equal expected, @response.body.strip
  1302
+    assert_equal "text/html", @response.content_type
  1303
+  end
  1304
+
1292 1305
   def test_partial_with_counter
1293 1306
     get :partial_with_counter
1294 1307
     assert_equal "5", @response.body
1  actionpack/test/fixtures/layouts/with_html_partial.html.erb
... ...
@@ -0,0 +1 @@
  1
+<%= render :partial => "partial_only_html" %><%= yield %>
1  actionpack/test/fixtures/test/with_xml_template.html.erb
... ...
@@ -0,0 +1 @@
  1
+<%= render :template => "test/greeting", :formats => :xml %>

0 notes on commit 7130f91

Please sign in to comment.
Something went wrong with that request. Please try again.