Make sure that tests restore the attachments path to the tmp dir so that fixture files don't get deleted.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8248 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang committed 2011-12-16 17:52:47 +00:00
1 parent 14b931eb4a
commit ad25e3807d
7 files changed
+18 -5

No files matched your search

+4
View File
@@ -97,6 +97,10 @@ class ActiveSupport::TestCase
Attachment.storage_path = "#{Rails.root}/tmp/test/attachments"
end
def set_fixtures_attachments_directory
Attachment.storage_path = "#{Rails.root}/test/fixtures/files"
end
def with_settings(options, &block)
saved_settings = options.keys.inject({}) {|h, k| h[k] = Setting[k].is_a?(Symbol) ? Setting[k] : Setting[k].dup; h}
options.each {|k, v| Setting[k] = v}