diff options
author | Jeremy Kemper <jeremykemper@gmail.com> | 2015-03-20 08:14:11 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremykemper@gmail.com> | 2015-03-20 08:14:11 -0700 |
commit | 5154089c181e9b36753b193bd7ffb141e88232f1 (patch) | |
tree | e72783fd1351026a4bd8847127abba222f44d118 /railties/test/application | |
parent | a4e7a6f9d63b93fff4ba78a32a930d1f5f97da29 (diff) | |
download | rails-5154089c181e9b36753b193bd7ffb141e88232f1.tar.gz rails-5154089c181e9b36753b193bd7ffb141e88232f1.tar.bz2 rails-5154089c181e9b36753b193bd7ffb141e88232f1.zip |
Revert "Merge pull request #19404 from dmathieu/remove_rack_env"
Preserving RACK_ENV behavior.
This reverts commit 7bdc7635b885e473f6a577264fd8efad1c02174f, reversing
changes made to 45786be516e13d55a1fca9a4abaddd5781209103.
Diffstat (limited to 'railties/test/application')
-rw-r--r-- | railties/test/application/rake/dbs_test.rb | 3 | ||||
-rw-r--r-- | railties/test/application/runner_test.rb | 6 |
2 files changed, 9 insertions, 0 deletions
diff --git a/railties/test/application/rake/dbs_test.rb b/railties/test/application/rake/dbs_test.rb index 1da108f1e1..c414732f92 100644 --- a/railties/test/application/rake/dbs_test.rb +++ b/railties/test/application/rake/dbs_test.rb @@ -203,7 +203,9 @@ module ApplicationTests test 'db:setup loads schema and seeds database' do begin @old_rails_env = ENV["RAILS_ENV"] + @old_rack_env = ENV["RACK_ENV"] ENV.delete "RAILS_ENV" + ENV.delete "RACK_ENV" app_file 'db/schema.rb', <<-RUBY ActiveRecord::Schema.define(version: "1") do @@ -223,6 +225,7 @@ module ApplicationTests end ensure ENV["RAILS_ENV"] = @old_rails_env + ENV["RACK_ENV"] = @old_rack_env end end end diff --git a/railties/test/application/runner_test.rb b/railties/test/application/runner_test.rb index b59202e68e..6595c40f8b 100644 --- a/railties/test/application/runner_test.rb +++ b/railties/test/application/runner_test.rb @@ -79,5 +79,11 @@ module ApplicationTests assert_match "production", Dir.chdir(app_path) { `bundle exec rails runner "puts Rails.env"` } end end + + def test_environment_with_rack_env + with_rack_env "production" do + assert_match "production", Dir.chdir(app_path) { `bundle exec rails runner "puts Rails.env"` } + end + end end end |