From 4f40b2d8fbcfb437a628a353eb281553fc840728 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 24 Jul 2005 16:45:39 +0000 Subject: Improved performance of test app req/sec with ~10% refactoring the render method #1823 [Stefan Kaes] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1915 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/controller/action_pack_assertions_test.rb | 2 +- actionpack/test/controller/active_record_assertions_test.rb | 8 ++++---- actionpack/test/controller/filters_test.rb | 12 ++++++------ actionpack/test/controller/flash_test.rb | 12 ++++++------ actionpack/test/controller/new_render_test.rb | 8 ++++---- 5 files changed, 21 insertions(+), 21 deletions(-) (limited to 'actionpack/test/controller') diff --git a/actionpack/test/controller/action_pack_assertions_test.rb b/actionpack/test/controller/action_pack_assertions_test.rb index bccff5ab98..e7faeb25cd 100644 --- a/actionpack/test/controller/action_pack_assertions_test.rb +++ b/actionpack/test/controller/action_pack_assertions_test.rb @@ -48,7 +48,7 @@ class ActionPackAssertionsController < ActionController::Base # assign some template instance variables def assign_this @howdy = "ho" - render_text "Mr. Henke" + render :inline => "Mr. Henke" end def render_based_on_parameters diff --git a/actionpack/test/controller/active_record_assertions_test.rb b/actionpack/test/controller/active_record_assertions_test.rb index 7b3478e2a8..d4cbda80e9 100644 --- a/actionpack/test/controller/active_record_assertions_test.rb +++ b/actionpack/test/controller/active_record_assertions_test.rb @@ -47,7 +47,7 @@ class ActiveRecordAssertionsController < ActionController::Base @company = Company.new @company.name = "B" @company.rating = 2 - render_text "snicker...." + render :inline => "snicker...." end # fail with 2 bad columns @@ -55,7 +55,7 @@ class ActiveRecordAssertionsController < ActionController::Base @company = Company.new @company.name = "" @company.rating = 2 - render_text "double snicker...." + render :inline => "double snicker...." end # this will pass validation @@ -63,13 +63,13 @@ class ActiveRecordAssertionsController < ActionController::Base @company = Company.new @company.name = "A" @company.rating = 69 - render_text "Goodness Gracious!" + render :inline => "Goodness Gracious!" end # this will fail validation def bad_company @company = Company.new - render_text "Who's Bad?" + render :inline => "Who's Bad?" end # the safety dance...... diff --git a/actionpack/test/controller/filters_test.rb b/actionpack/test/controller/filters_test.rb index 5480843e22..1bd625f084 100644 --- a/actionpack/test/controller/filters_test.rb +++ b/actionpack/test/controller/filters_test.rb @@ -5,7 +5,7 @@ class FilterTest < Test::Unit::TestCase before_filter :ensure_login def show - render_text "ran action" + render :inline => "ran action" end private @@ -20,26 +20,26 @@ class FilterTest < Test::Unit::TestCase def show @ran_action = true - render_text "ran action" + render :inline => "ran action" end private def render_something_else - render_text "something else" + render :inline => "something else" end end class ConditionalFilterController < ActionController::Base def show - render_text "ran action" + render :inline => "ran action" end def another_action - render_text "ran action" + render :inline => "ran action" end def show_without_filter - render_text "ran action without filter" + render :inline => "ran action without filter" end private diff --git a/actionpack/test/controller/flash_test.rb b/actionpack/test/controller/flash_test.rb index 3a6e828bc8..54a1444f97 100644 --- a/actionpack/test/controller/flash_test.rb +++ b/actionpack/test/controller/flash_test.rb @@ -4,32 +4,32 @@ class FlashTest < Test::Unit::TestCase class TestController < ActionController::Base def set_flash flash["that"] = "hello" - render_text "hello" + render :inline => "hello" end def set_flash_now flash.now["that"] = "hello" @flash_copy = {}.update flash - render_text "hello" + render :inline => "hello" end def attempt_to_use_flash_now @flash_copy = {}.update flash @flashy = flash["that"] - render_text "hello" + render :inline => "hello" end def use_flash @flash_copy = {}.update flash @flashy = flash["that"] - render_text "hello" + render :inline => "hello" end def use_flash_and_keep_it @flash_copy = {}.update flash @flashy = flash["that"] keep_flash - render_text "hello" + render :inline => "hello" end def rescue_action(e) @@ -91,4 +91,4 @@ class FlashTest < Test::Unit::TestCase def process_request TestController.process(@request, @response) end -end \ No newline at end of file +end diff --git a/actionpack/test/controller/new_render_test.rb b/actionpack/test/controller/new_render_test.rb index cd7a813df2..b2e3b6b399 100644 --- a/actionpack/test/controller/new_render_test.rb +++ b/actionpack/test/controller/new_render_test.rb @@ -311,8 +311,8 @@ class NewRenderTest < Test::Unit::TestCase assert_equal "Talking to the layout\nAction was here!", @response.body end - # def test_partials_list - # get :partials_list - # assert_equal "goodbyeHello: davidHello: marygoodbye\n", @response.body - # end + def test_partials_list + get :partials_list + assert_equal "goodbyeHello: davidHello: marygoodbye\n", @response.body + end end \ No newline at end of file -- cgit v1.2.3