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.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