Permalink
Browse files

run the load_structure test in the test environment

  • Loading branch information...
1 parent 44298c3 commit e3f5d023fffa59ae593810c702f5d6be0ef45651 @hone hone committed Feb 20, 2013
Showing with 10 additions and 3 deletions.
  1. +10 −3 railties/test/application/rake/dbs_test.rb
@@ -168,9 +168,16 @@ def db_test_load_structure
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

0 comments on commit e3f5d02

Please sign in to comment.