提交 188934cd 编写于 作者: E eileencodes

Fix ActionPack tests after changes to missing template logger

After merging #19377 ActionPack tests were missing a require for
`ActiveSupport::LogSubscriber::TestHelper` and change didn't take
into account that logger could be nil. Added the require and only log to
info if logger exists.

This wasn't caught earlier because these tests only run after a merge.
上级 6b98fbac
......@@ -10,7 +10,7 @@ def default_render(*args)
if template_exists?(action_name.to_s, _prefixes, variants: request.variant)
render(*args)
else
logger.info "No template found for #{self.class.name}\##{action_name}, rendering head :no_content"
logger.info "No template found for #{self.class.name}\##{action_name}, rendering head :no_content" if logger
head :no_content
end
end
......
require 'abstract_unit'
require "active_support/log_subscriber/test_helper"
class RespondToController < ActionController::Base
layout :set_layout
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册