Patch #1782 ยป patch_for_running_tests_with_git.patch
| test/test_helper.rb (working copy) | ||
|---|---|---|
|
|
||
|
# 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")
|
||
|
FileUtils.mkpath "#{RAILS_ROOT}/tmp/test" unless File.directory?("#{RAILS_ROOT}/tmp/test")
|
||
|
FileUtils.mkpath "#{RAILS_ROOT}/tmp/test/attachments" unless File.directory?("#{RAILS_ROOT}/tmp/test/attachments")
|
||
|
Attachment.storage_path = "#{RAILS_ROOT}/tmp/test/attachments"
|
||
|
end
|
||
|
end
|
||