summaryrefslogtreecommitdiffstats
path: root/test/test_helper.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-06-01 18:25:23 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-06-01 18:25:23 +0000
commitf414e3c8637aac2d458367176891472a9e90dbf2 (patch)
treef7fa3c09115fc1d0d7f134946d13ad1ab570280c /test/test_helper.rb
parent966f238da459fda40be8db48904dad7e4266a443 (diff)
downloadredmine-f414e3c8637aac2d458367176891472a9e90dbf2.tar.gz
redmine-f414e3c8637aac2d458367176891472a9e90dbf2.zip
Create tmp directory on test launch.
git-svn-id: http://svn.redmine.org/redmine/trunk@16587 e93f8b46-1217-0410-a6f0-8f06a7374b81
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