From 59e9478f57216999c12580c42cb9149894090123 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Sun, 31 Jan 2010 13:37:43 -0600 Subject: Require ac/test_case from AV::TestCase --- actionpack/lib/action_view/test_case.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'actionpack/lib/action_view/test_case.rb') diff --git a/actionpack/lib/action_view/test_case.rb b/actionpack/lib/action_view/test_case.rb index 16d66b6eca..3095d84e13 100644 --- a/actionpack/lib/action_view/test_case.rb +++ b/actionpack/lib/action_view/test_case.rb @@ -1,3 +1,5 @@ +require 'action_controller/test_case' + module ActionView class Base alias_method :initialize_without_template_tracking, :initialize -- cgit v1.2.3 From 4cbb9db0a5ff65b0a626a5b043331abefd89e717 Mon Sep 17 00:00:00 2001 From: Yehuda Katz Date: Sun, 31 Jan 2010 19:17:42 -0800 Subject: For performance reasons, you can no longer call html_safe! on Strings. Instead, all Strings are always not html_safe?. Instead, you can get a SafeBuffer from a String by calling #html_safe, which will SafeBuffer.new(self). * Additionally, instead of doing concat("".html_safe), you can do safe_concat(""), which will skip both the flag set, and the flag check. * For the first pass, I converted virtually all #html_safe!s to #html_safe, and the tests pass. A further optimization would be to try to use #safe_concat as much as possible, reducing the performance impact if we know up front that a String is safe. --- actionpack/lib/action_view/test_case.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib/action_view/test_case.rb') diff --git a/actionpack/lib/action_view/test_case.rb b/actionpack/lib/action_view/test_case.rb index 3095d84e13..fc29acea6d 100644 --- a/actionpack/lib/action_view/test_case.rb +++ b/actionpack/lib/action_view/test_case.rb @@ -53,7 +53,7 @@ module ActionView setup :setup_with_controller def setup_with_controller @controller = TestController.new - @output_buffer = ActionView::SafeBuffer.new + @output_buffer = ActiveSupport::SafeBuffer.new @rendered = '' self.class.send(:include_helper_modules!) -- cgit v1.2.3