mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Merge pull request #5101 from ckdake/ckdake_actionview_handler_reset
Reset memoized hash keys when new ActionView::Template handler is registered
This commit is contained in:
@@ -26,6 +26,7 @@ module ActionView #:nodoc:
|
||||
# return the rendered template as a string.
|
||||
def register_template_handler(extension, klass)
|
||||
@@template_handlers[extension.to_sym] = klass
|
||||
@@template_extensions = nil
|
||||
end
|
||||
|
||||
def template_handler_extensions
|
||||
|
||||
@@ -329,6 +329,12 @@ module RenderTestCases
|
||||
ActionView::Template.register_template_handler :foo, CustomHandler
|
||||
assert_equal 'source: "Hello, <%= name %>!"', @view.render(:inline => "Hello, <%= name %>!", :locals => { :name => "Josh" }, :type => :foo)
|
||||
end
|
||||
|
||||
def test_render_knows_about_types_registered_when_extensions_are_checked_earlier_in_initialization
|
||||
ActionView::Template::Handlers.extensions
|
||||
ActionView::Template.register_template_handler :foo, CustomHandler
|
||||
assert ActionView::Template::Handlers.extensions.include?(:foo)
|
||||
end
|
||||
|
||||
def test_render_ignores_templates_with_malformed_template_handlers
|
||||
ActiveSupport::Deprecation.silence do
|
||||
|
||||
Reference in New Issue
Block a user