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
This commit is contained in:
Toshi MARUYAMA 2011-06-16 04:02:31 +00:00
parent 153028f14a
commit d893bdcd76
1 changed files with 6 additions and 4 deletions

View File

@ -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}