summaryrefslogtreecommitdiffstats
path: root/test/test_helper.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-06-09 18:40:59 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-06-09 18:40:59 +0000
commit80a7486f95a39ad3fc0946fad17fe51cff01cec6 (patch)
tree43e4ce8c5d338458359b5a8cf389972c93ac56f3 /test/test_helper.rb
parentaa0beecad0fa7cd8c62816b4dc7918f03b214b91 (diff)
downloadredmine-80a7486f95a39ad3fc0946fad17fe51cff01cec6.tar.gz
redmine-80a7486f95a39ad3fc0946fad17fe51cff01cec6.zip
File viewer for attached text files.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1520 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/test_helper.rb')
-rw-r--r--test/test_helper.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/test_helper.rb b/test/test_helper.rb
index 61670318a..150b063e8 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -57,6 +57,12 @@ class Test::Unit::TestCase
def test_uploaded_file(name, mime)
ActionController::TestUploadedFile.new(Test::Unit::TestCase.fixture_path + "/files/#{name}", mime)
end
+
+ # Use a temporary directory for attachment related tests
+ def set_tmp_attachments_directory
+ Dir.mkdir "#{RAILS_ROOT}/tmp/test/attachments" unless File.directory?("#{RAILS_ROOT}/tmp/test/attachments")
+ Attachment.storage_path = "#{RAILS_ROOT}/tmp/test/attachments"
+ end
end