aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/new_base/render_partial_test.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-10-07 20:48:21 +0200
committerJosé Valim <jose.valim@gmail.com>2010-10-07 21:31:31 +0200
commitc563f10f3e8083bebe32200fa065748c8bcb65c9 (patch)
treef014b8ab578bc88d9ba5847d3695584d2da733ec /actionpack/test/controller/new_base/render_partial_test.rb
parent8f9e9118e402ea2fe1eec6fcb9a2d3f0c84b3b46 (diff)
downloadrails-c563f10f3e8083bebe32200fa065748c8bcb65c9.tar.gz
rails-c563f10f3e8083bebe32200fa065748c8bcb65c9.tar.bz2
rails-c563f10f3e8083bebe32200fa065748c8bcb65c9.zip
render :template => 'foo/bar.json' now works as it should.
Diffstat (limited to 'actionpack/test/controller/new_base/render_partial_test.rb')
-rw-r--r--actionpack/test/controller/new_base/render_partial_test.rb17
1 files changed, 15 insertions, 2 deletions
diff --git a/actionpack/test/controller/new_base/render_partial_test.rb b/actionpack/test/controller/new_base/render_partial_test.rb
index 5c7e66dba2..d800ea264d 100644
--- a/actionpack/test/controller/new_base/render_partial_test.rb
+++ b/actionpack/test/controller/new_base/render_partial_test.rb
@@ -5,10 +5,17 @@ module RenderPartial
class BasicController < ActionController::Base
self.view_paths = [ActionView::FixtureResolver.new(
- "render_partial/basic/_basic.html.erb" => "BasicPartial!",
- "render_partial/basic/basic.html.erb" => "<%= @test_unchanged = 'goodbye' %><%= render :partial => 'basic' %><%= @test_unchanged %>"
+ "render_partial/basic/_basic.html.erb" => "BasicPartial!",
+ "render_partial/basic/basic.html.erb" => "<%= @test_unchanged = 'goodbye' %><%= render :partial => 'basic' %><%= @test_unchanged %>",
+ "render_partial/basic/with_json.html.erb" => "<%= render 'with_json.json' %>",
+ "render_partial/basic/_with_json.json.erb" => "<%= render 'final' %>",
+ "render_partial/basic/_final.json.erb" => "{ final: json }"
)]
+ def html_with_json_inside_json
+ render :action => "with_json"
+ end
+
def changing
@test_unchanged = 'hello'
render :action => "basic"
@@ -22,6 +29,12 @@ module RenderPartial
get :changing
assert_response("goodbyeBasicPartial!goodbye")
end
+
+ test "rendering a template with renders another partial with other format that renders other partial in the same format" do
+ get :html_with_json_inside_json
+ assert_content_type "text/html; charset=utf-8"
+ assert_response "{ final: json }"
+ end
end
end