提交 93ec552e 编写于 作者: J Jeremy Kemper

Fix up template handler tests. Closes #10437.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8372 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 fade31ad
......@@ -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
......
xml.html do
xml.p "Hello"
end
"String return value"
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册