Skip to content

Commit 6b212be

Browse files
committed
Fix spec helper load error by requiring logger
1 parent 5bc02c2 commit 6b212be

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

spec/dummy/config/application.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
# require "action_mailer/railtie"
77
# require "sprockets/railtie"
88

9+
# Workaround for Rails 6 requiring Logger before ActiveSupport modules
10+
require 'logger'
911
require 'rails/all'
1012
# require "rails/test_unit/railtie"
1113

spec/dummy/config/environments/test.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,9 @@
3333

3434
# Print deprecation notices to the stderr.
3535
config.active_support.deprecation = :stderr
36+
37+
# Allow unsafe YAML loading for tests with Rails >= 6
38+
if defined?(ActiveRecord::Base) && ActiveRecord::Base.respond_to?(:use_yaml_unsafe_load=)
39+
ActiveRecord::Base.use_yaml_unsafe_load = true
40+
end
3641
end

0 commit comments

Comments
 (0)