summaryrefslogtreecommitdiffstats
path: root/test/test_helper.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-06-16 04:02:31 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-06-16 04:02:31 +0000
commitd893bdcd768e22f203a7212fcb8a8400eb044c3f (patch)
treee5a03c5b03139c3321bcb7d705ef2557e12dccc1 /test/test_helper.rb
parent153028f14a71cf4fece3a7c43dd2d97e99c6b161 (diff)
downloadredmine-d893bdcd768e22f203a7212fcb8a8400eb044c3f.tar.gz
redmine-d893bdcd768e22f203a7212fcb8a8400eb044c3f.zip
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
Diffstat (limited to 'test/test_helper.rb')
-rw-r--r--test/test_helper.rb10
1 files changed, 6 insertions, 4 deletions
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}