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