From 0187053109f62ea0188a76aee53aeee396f76632 Mon Sep 17 00:00:00 2001 From: "yuuji.yaginuma" Date: Thu, 14 Mar 2019 15:39:23 +0900 Subject: Make application work without tmp directory The tmp directory is added to version control in the newly created application. This was added in Rails 5.0.0(https://github.com/rails/rails/commit/f06ce4c12a396795a3b2c1812951d9277bcb3a82). However, applications created before that are not guaranteed to have the tmp directory. If the tmp directory does not exist, writing to the key file raise error. This is a bit incompatible. So I fixed that create the directory before writing a key. --- railties/test/application/configuration_test.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'railties/test/application') diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb index eee2d633be..e34c075a1c 100644 --- a/railties/test/application/configuration_test.rb +++ b/railties/test/application/configuration_test.rb @@ -601,6 +601,9 @@ module ApplicationTests Rails.application.credentials.secret_key_base = nil RUBY + # For test that works even if tmp dir does not exist. + Dir.chdir(app_path) { FileUtils.remove_dir("tmp") } + app "development" assert_not_nil app.secrets.secret_key_base -- cgit v1.2.3