diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2017-12-08 13:27:30 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2017-12-08 13:27:30 -0800 |
commit | cd0283ef29eaa4a8eb9c90d6c2efaccb20012a20 (patch) | |
tree | 3dbfe8a0395d048f7211228df87af5a92ce27ede | |
parent | a58543dbb1ea52f3cb0c98d054ffd7bc7a373765 (diff) | |
download | rails-cd0283ef29eaa4a8eb9c90d6c2efaccb20012a20.tar.gz rails-cd0283ef29eaa4a8eb9c90d6c2efaccb20012a20.tar.bz2 rails-cd0283ef29eaa4a8eb9c90d6c2efaccb20012a20.zip |
Revert "remove unnecessary `RAILS_ENV` setting"
This reverts commit 9a80f52541ed2c93ebef02909ecab3aaf9127150.
-rw-r--r-- | railties/lib/rails/generators/rails/app/templates/test/test_helper.rb.tt | 1 | ||||
-rw-r--r-- | railties/lib/rails/generators/rails/plugin/templates/test/test_helper.rb.tt | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/railties/lib/rails/generators/rails/app/templates/test/test_helper.rb.tt b/railties/lib/rails/generators/rails/app/templates/test/test_helper.rb.tt index 6ad1f11781..52d68cc77c 100644 --- a/railties/lib/rails/generators/rails/app/templates/test/test_helper.rb.tt +++ b/railties/lib/rails/generators/rails/app/templates/test/test_helper.rb.tt @@ -1,3 +1,4 @@ +ENV['RAILS_ENV'] ||= 'test' require_relative '../config/environment' require 'rails/test_help' diff --git a/railties/lib/rails/generators/rails/plugin/templates/test/test_helper.rb.tt b/railties/lib/rails/generators/rails/plugin/templates/test/test_helper.rb.tt index 7fa9973931..755d19ef5d 100644 --- a/railties/lib/rails/generators/rails/plugin/templates/test/test_helper.rb.tt +++ b/railties/lib/rails/generators/rails/plugin/templates/test/test_helper.rb.tt @@ -1,3 +1,6 @@ +# Configure Rails Environment +ENV["RAILS_ENV"] = "test" + require_relative "<%= File.join('..', options[:dummy_path], 'config/environment') -%>" <% unless options[:skip_active_record] -%> ActiveRecord::Migrator.migrations_paths = [File.expand_path("../<%= options[:dummy_path] -%>/db/migrate", __dir__)] |