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

Set the application logger using configuration

This commit is contained in:
Rafael Mendonça França 2014-07-07 22:57:55 -03:00
parent d3af622586
commit 57e298fcd5

View file

@ -11,10 +11,12 @@ module ApplicationTests
def setup
build_app
add_to_config <<-RUBY
config.logger = ActiveSupport::LogSubscriber::TestHelper::MockLogger.new
RUBY
require "#{app_path}/config/environment"
super
@logger = MockLogger.new
Rails.stubs(:logger).returns(@logger)
end
def teardown
@ -23,7 +25,7 @@ module ApplicationTests
end
def logs
@logs ||= @logger.logged(:info).join("\n")
@logs ||= Rails.logger.logged(:info).join("\n")
end
test "logger logs proper HTTP GET verb and path" do