1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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.
This commit is contained in:
eileencodes 2015-04-06 09:03:13 -04:00
parent 6b98fbacf7
commit 188934cdac
2 changed files with 2 additions and 1 deletions

View file

@ -10,7 +10,7 @@ module ActionController
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

View file

@ -1,4 +1,5 @@
require 'abstract_unit'
require "active_support/log_subscriber/test_helper"
class RespondToController < ActionController::Base
layout :set_layout