From 93ec552e9b76be7491dfe06c09e0e636dfd0d3a3 Mon Sep 17 00:00:00 2001
From: Jeremy Kemper <jeremy@bitsweat.net>
Date: Mon, 10 Dec 2007 20:41:59 +0000
Subject: Fix up template handler tests. Closes #10437.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8372 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
---
 actionpack/lib/action_view/base.rb | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

(limited to 'actionpack/lib')

diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb
index 228e3f55a5..24cbdcf81d 100644
--- a/actionpack/lib/action_view/base.rb
+++ b/actionpack/lib/action_view/base.rb
@@ -252,6 +252,10 @@ module ActionView #:nodoc:
       @@template_handlers[extension.to_sym] || @@default_template_handlers
     end
 
+    def self.template_handler_extensions
+      @@template_handler_extensions ||= @@template_handlers.keys.map(&:to_s).sort
+    end
+
     register_default_template_handler :erb, TemplateHandlers::ERB
     register_template_handler :rjs, TemplateHandlers::RJS
     register_template_handler :builder, TemplateHandlers::Builder
@@ -500,7 +504,7 @@ If you are rendering a subtemplate, you must now use controller-like partial syn
       def find_template_extension_from_handler(template_path, formatted = nil)
         checked_template_path = formatted ? "#{template_path}.#{template_format}" : template_path
 
-        @@template_handlers.each do |extension,|
+        self.class.template_handler_extensions.each do |extension|
           if template_exists?(checked_template_path, extension)
             return formatted ? "#{template_format}.#{extension}" : extension.to_s
           end
-- 
cgit v1.2.3