Skip to content

Commit

Permalink
Make sure log level in development is debug
Browse files Browse the repository at this point in the history
Laso make sure the tests are actually checking the log level of the app,
not the one we set in the test helper.
  • Loading branch information
rafaelfranca committed Sep 22, 2020
1 parent 70018f8 commit 7307994
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion railties/lib/rails/application/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def initialize(*)
@session_store = nil
@time_zone = "UTC"
@beginning_of_week = :monday
@log_level = :info
@log_level = :debug
@generators = app_generators
@cache_store = [ :file_store, "#{root}/tmp/cache/" ]
@railties_order = [:all]
Expand Down
11 changes: 9 additions & 2 deletions railties/test/application/configuration_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1577,8 +1577,15 @@ def index
assert_equal session_options, app.config.session_options
end

test "config.log_level defaults to info" do
make_basic_app
test "config.log_level defaults to debug in development" do
app "development"

assert_equal Logger::DEBUG, Rails.logger.level
end

test "config.log_level default to info in production" do
app "production"

assert_equal Logger::INFO, Rails.logger.level
end

Expand Down
1 change: 0 additions & 1 deletion railties/test/isolation/abstract_unit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ def build_app(options = {})
config.session_store :cookie_store, key: "_myapp_session"
config.active_support.deprecation = :log
config.action_controller.allow_forgery_protection = false
config.log_level = :info
RUBY
end

Expand Down

0 comments on commit 7307994

Please sign in to comment.