aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
authorTerence Lee <hone02@gmail.com>2013-02-21 00:44:26 +1100
committerTerence Lee <hone02@gmail.com>2013-02-21 01:25:05 +1100
commite3f5d023fffa59ae593810c702f5d6be0ef45651 (patch)
treeb4d3ca6eff682b617e22a7e3fbf863abd53c680f /railties/test
parent44298c39e49d48546f3546a885c9da362bd48f28 (diff)
downloadrails-e3f5d023fffa59ae593810c702f5d6be0ef45651.tar.gz
rails-e3f5d023fffa59ae593810c702f5d6be0ef45651.tar.bz2
rails-e3f5d023fffa59ae593810c702f5d6be0ef45651.zip
run the load_structure test in the test environment
Diffstat (limited to 'railties/test')
-rw-r--r--railties/test/application/rake/dbs_test.rb13
1 files changed, 10 insertions, 3 deletions
diff --git a/railties/test/application/rake/dbs_test.rb b/railties/test/application/rake/dbs_test.rb
index 813680738a..820b838702 100644
--- a/railties/test/application/rake/dbs_test.rb
+++ b/railties/test/application/rake/dbs_test.rb
@@ -168,9 +168,16 @@ module ApplicationTests
end
test 'db:test:load_structure with database_url' do
- require "#{app_path}/config/environment"
- set_database_url
- db_test_load_structure
+ old_rails_env = ENV["RAILS_ENV"]
+ ENV["RAILS_ENV"] = 'test'
+
+ begin
+ require "#{app_path}/config/environment"
+ set_database_url
+ db_test_load_structure
+ ensure
+ ENV["RAILS_ENV"] = old_rails_env
+ end
end
end
end