Skip to content

Commit a764196

Browse files
authored
chore: use Rails load_defaults for test runs (#473)
1 parent 6b56061 commit a764196

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

test/mounted_app/test/dummy/config/application.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212

1313
module TestDummyApp
1414
class Application < Rails::Application
15-
config.secret_key_base = 'abcdef'
15+
config.load_defaults Rails::VERSION::STRING.to_f
16+
config.secret_key_base = SecureRandom.hex
1617
config.eager_load = true
1718
end
1819
end

test/test_app/config/application.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,14 @@ class Rails::Console; end
1818

1919
module TestApp
2020
class Application < ::Rails::Application
21-
config.secret_key_base = 'abcdef'
21+
config.load_defaults Rails::VERSION::STRING.to_f
22+
config.secret_key_base = SecureRandom.hex
2223
config.eager_load = true
2324
config.active_support.test_order = :sorted
25+
26+
if Rails.gem_version >= Gem::Version.new('7.0.0')
27+
# Option added in Rails 7.0, defaults to false. Some helper_test tests assume true.
28+
config.action_view.apply_stylesheet_media_default = true
29+
end
2430
end
2531
end

0 commit comments

Comments
 (0)