diff options
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/new_render_test.rb | 13 | ||||
-rw-r--r-- | actionpack/test/controller/send_file_test.rb | 2 |
2 files changed, 14 insertions, 1 deletions
diff --git a/actionpack/test/controller/new_render_test.rb b/actionpack/test/controller/new_render_test.rb index ad1415aca3..3d1e6e794b 100644 --- a/actionpack/test/controller/new_render_test.rb +++ b/actionpack/test/controller/new_render_test.rb @@ -75,6 +75,10 @@ class TestController < ActionController::Base render :partial => true end + def partial_only_with_layout + render :partial => "partial_only", :layout => nil + end + def hello_in_a_string @customers = [ Customer.new("david"), Customer.new("mary") ] render :text => "How's there? #{render_to_string("test/list")}" @@ -89,7 +93,9 @@ class TestController < ActionController::Base private def determine_layout case action_name - when "layout_test", "rendering_without_layout", "rendering_nothing_on_layout" + when "layout_test", "rendering_without_layout", + "rendering_nothing_on_layout", "render_text_hello_world", + "partial_only", "partial_only_with_layout" "layouts/standard" when "builder_layout_test" "layouts/builder" @@ -219,6 +225,11 @@ class RenderTest < Test::Unit::TestCase assert_equal "only partial", @response.body end + def test_partial_only_with_layout + get :partial_only_with_layout + assert_equal "<html>only partial</html>", @response.body + end + def test_render_to_string get :hello_in_a_string assert_equal "How's there? Hello: davidHello: mary", @response.body diff --git a/actionpack/test/controller/send_file_test.rb b/actionpack/test/controller/send_file_test.rb index d18d15b18a..b7674bda60 100644 --- a/actionpack/test/controller/send_file_test.rb +++ b/actionpack/test/controller/send_file_test.rb @@ -10,6 +10,7 @@ end class SendFileController < ActionController::Base include TestFileUtils + layout "layouts/standard" # to make sure layouts don't interfere attr_writer :options def options() @options ||= {} end @@ -20,6 +21,7 @@ class SendFileController < ActionController::Base def rescue_action(e) raise end end +SendFileController.template_root = File.dirname(__FILE__) + "/../fixtures/" class SendFileTest < Test::Unit::TestCase include TestFileUtils |