aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authoryuuji.yaginuma <yuuji.yaginuma@gmail.com>2016-09-22 17:25:09 +0900
committeryuuji.yaginuma <yuuji.yaginuma@gmail.com>2016-09-22 17:39:14 +0900
commit9a80f52541ed2c93ebef02909ecab3aaf9127150 (patch)
tree23aea98687021dfcfd72320fb0dadf96633a4857 /railties
parent19966242163611e61d45ee4033f28aa6f967906a (diff)
downloadrails-9a80f52541ed2c93ebef02909ecab3aaf9127150.tar.gz
rails-9a80f52541ed2c93ebef02909ecab3aaf9127150.tar.bz2
rails-9a80f52541ed2c93ebef02909ecab3aaf9127150.zip
remove unnecessary `RAILS_ENV` setting
`RAILS_ENV` is always set in the initialization process of test runner. https://github.com/rails/rails/blob/9fa07095a35be2d8cb5adcc992b988e73a6d9719/railties/lib/rails/test_unit/minitest_plugin.rb#L74 Therefore, it is not necessary to set in `test_helper`.
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/generators/rails/app/templates/test/test_helper.rb1
-rw-r--r--railties/lib/rails/generators/rails/plugin/templates/test/test_helper.rb3
2 files changed, 0 insertions, 4 deletions
diff --git a/railties/lib/rails/generators/rails/app/templates/test/test_helper.rb b/railties/lib/rails/generators/rails/app/templates/test/test_helper.rb
index 87b8fe3516..2f92168eef 100644
--- a/railties/lib/rails/generators/rails/app/templates/test/test_helper.rb
+++ b/railties/lib/rails/generators/rails/app/templates/test/test_helper.rb
@@ -1,4 +1,3 @@
-ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
diff --git a/railties/lib/rails/generators/rails/plugin/templates/test/test_helper.rb b/railties/lib/rails/generators/rails/plugin/templates/test/test_helper.rb
index a5eebcb19f..e84e403018 100644
--- a/railties/lib/rails/generators/rails/plugin/templates/test/test_helper.rb
+++ b/railties/lib/rails/generators/rails/plugin/templates/test/test_helper.rb
@@ -1,6 +1,3 @@
-# Configure Rails Environment
-ENV["RAILS_ENV"] = "test"
-
require File.expand_path("../../<%= options[:dummy_path] -%>/config/environment.rb", __FILE__)
<% unless options[:skip_active_record] -%>
ActiveRecord::Migrator.migrations_paths = [File.expand_path("../../<%= options[:dummy_path] -%>/db/migrate", __FILE__)]