@@ -78,11 +78,13 class ActiveSupport::TestCase | |||||
78 |
|
78 | |||
79 | # Use a temporary directory for attachment related tests |
|
79 | # Use a temporary directory for attachment related tests | |
80 | def set_tmp_attachments_directory |
|
80 | def set_tmp_attachments_directory | |
81 |
Dir.mkdir "#{R |
|
81 | Dir.mkdir "#{Rails.root}/tmp/test" unless File.directory?("#{Rails.root}/tmp/test") | |
82 |
|
|
82 | unless File.directory?("#{Rails.root}/tmp/test/attachments") | |
83 | Attachment.storage_path = "#{RAILS_ROOT}/tmp/test/attachments" |
|
83 | Dir.mkdir "#{Rails.root}/tmp/test/attachments" | |
|
84 | end | |||
|
85 | Attachment.storage_path = "#{Rails.root}/tmp/test/attachments" | |||
84 | end |
|
86 | end | |
85 |
|
87 | |||
86 | def with_settings(options, &block) |
|
88 | def with_settings(options, &block) | |
87 | saved_settings = options.keys.inject({}) {|h, k| h[k] = Setting[k].dup; h} |
|
89 | saved_settings = options.keys.inject({}) {|h, k| h[k] = Setting[k].dup; h} | |
88 | options.each {|k, v| Setting[k] = v} |
|
90 | options.each {|k, v| Setting[k] = v} |
General Comments 0
You need to be logged in to leave comments.
Login now