Merged trunk r1773.
git-svn-id: http://redmine.rubyforge.org/svn/branches/work@1774 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -57,21 +57,11 @@ class Test::Unit::TestCase
|
||||
def test_uploaded_file(name, mime)
|
||||
ActionController::TestUploadedFile.new(Test::Unit::TestCase.fixture_path + "/files/#{name}", mime)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
# ActionController::TestUploadedFile bug
|
||||
# see http://dev.rubyonrails.org/ticket/4635
|
||||
class String
|
||||
def original_filename
|
||||
"testfile.txt"
|
||||
end
|
||||
|
||||
def content_type
|
||||
"text/plain"
|
||||
end
|
||||
|
||||
def read
|
||||
self.to_s
|
||||
# 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")
|
||||
Attachment.storage_path = "#{RAILS_ROOT}/tmp/test/attachments"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user