Merged r3258 and r3281 from trunk.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/0.9-stable@3286 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2010-01-09 10:02:16 +00:00
parent 9d2474c234
commit 4c75864948
6 changed files with 46 additions and 4 deletions
+8
View File
@@ -38,6 +38,14 @@ class AttachmentTest < ActiveSupport::TestCase
assert File.exist?(a.diskfile)
end
def test_create_should_auto_assign_content_type
a = Attachment.new(:container => Issue.find(1),
:file => uploaded_test_file("testfile.txt", ""),
:author => User.find(1))
assert a.save
assert_equal 'text/plain', a.content_type
end
def test_diskfilename
assert Attachment.disk_filename("test_file.txt") =~ /^\d{12}_test_file.txt$/
assert_equal 'test_file.txt', Attachment.disk_filename("test_file.txt")[13..-1]