summaryrefslogtreecommitdiffstats
path: root/test/test_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_helper.rb')
-rw-r--r--test/test_helper.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/test_helper.rb b/test/test_helper.rb
index 1d99ce906..76771d438 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -34,9 +34,13 @@ include ObjectHelpers
require 'net/ldap'
require 'mocha/setup'
+require 'fileutils'
Redmine::SudoMode.disable!
+$redmine_tmp_attachments_directory = "#{Rails.root}/tmp/test/attachments"
+FileUtils.mkdir_p $redmine_tmp_attachments_directory
+
class ActionView::TestCase
helper :application
include ApplicationHelper
@@ -68,11 +72,7 @@ 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")
- unless File.directory?("#{Rails.root}/tmp/test/attachments")
- Dir.mkdir "#{Rails.root}/tmp/test/attachments"
- end
- Attachment.storage_path = "#{Rails.root}/tmp/test/attachments"
+ Attachment.storage_path = $redmine_tmp_attachments_directory
end
def set_fixtures_attachments_directory