From: Toshi MARUYAMA Date: Thu, 16 Jun 2011 04:02:31 +0000 (+0000) Subject: replace RAILS_ROOT to Rails.root in test/test_helper.rb. X-Git-Tag: 1.3.0~1810 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d893bdcd768e22f203a7212fcb8a8400eb044c3f;p=redmine.git replace RAILS_ROOT to Rails.root in test/test_helper.rb. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6081 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/test/test_helper.rb b/test/test_helper.rb index e8474de15..51eaae13e 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -78,11 +78,13 @@ class ActiveSupport::TestCase # Use a temporary directory for attachment related tests def set_tmp_attachments_directory - Dir.mkdir "#{RAILS_ROOT}/tmp/test" unless File.directory?("#{RAILS_ROOT}/tmp/test") - Dir.mkdir "#{RAILS_ROOT}/tmp/test/attachments" unless File.directory?("#{RAILS_ROOT}/tmp/test/attachments") - Attachment.storage_path = "#{RAILS_ROOT}/tmp/test/attachments" + Dir.mkdir "#{Rails.root}/tmp/test" unless File.directory?("#{Rails.root}/tmp/test") + unless File.directory?("#{Rails.root}/tmp/test/attachments") + Dir.mkdir "#{Rails.root}/tmp/test/attachments" + end + Attachment.storage_path = "#{Rails.root}/tmp/test/attachments" end - + def with_settings(options, &block) saved_settings = options.keys.inject({}) {|h, k| h[k] = Setting[k].dup; h} options.each {|k, v| Setting[k] = v}