Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit 93ec552e9b76be7491dfe06c09e0e636dfd0d3a3 1 parent fade31a
@jeremy jeremy authored
View
6 actionpack/lib/action_view/base.rb
@@ -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
View
4 actionpack/test/controller/new_render_test.rb
@@ -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
View
4 actionpack/test/fixtures/test/hello_world.builder
@@ -1,4 +0,0 @@
-xml.html do
- xml.p "Hello"
-end
-"String return value"
Please sign in to comment.
Something went wrong with that request. Please try again.