Permalink
Browse files

Fix up template handler tests. Closes #10437.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8372 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent fade31a commit 93ec552e9b76be7491dfe06c09e0e636dfd0d3a3 @jeremy jeremy committed Dec 10, 2007
@@ -252,6 +252,10 @@ def self.handler_for_extension(extension)
@@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 @@ def find_template_extension_for(template_path)
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
@@ -241,11 +241,11 @@ def @template.name() nil end
end
def hello_world_from_rxml_using_action
- render :action => "hello_world.builder"
+ render :action => "hello_world_from_rxml.builder"
end
def hello_world_from_rxml_using_template
- render :template => "test/hello_world.builder"
+ render :template => "test/hello_world_from_rxml.builder"
end
def head_with_location_header
@@ -1,4 +0,0 @@
-xml.html do
- xml.p "Hello"
-end
-"String return value"

0 comments on commit 93ec552

Please sign in to comment.