mirror of
https://github.com/meineerde/redmine.git
synced 2026-03-20 15:59:53 +00:00
Patch by Pavel Rosický. git-svn-id: http://svn.redmine.org/redmine/trunk@21194 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
1578c7207b
commit
1bfdccc30f
@ -276,27 +276,31 @@ class AttachmentTest < ActiveSupport::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_create_diskfile
|
def test_create_diskfile
|
||||||
|
path = nil
|
||||||
Attachment.create_diskfile("test_file.txt") do |f|
|
Attachment.create_diskfile("test_file.txt") do |f|
|
||||||
path = f.path
|
path = f.path
|
||||||
assert_match(/^\d{12}_test_file.txt$/, File.basename(path))
|
assert_match(/^\d{12}_test_file.txt$/, File.basename(path))
|
||||||
assert_equal 'test_file.txt', File.basename(path)[13..-1]
|
assert_equal 'test_file.txt', File.basename(path)[13..-1]
|
||||||
File.unlink f.path
|
|
||||||
end
|
end
|
||||||
|
File.unlink path
|
||||||
|
|
||||||
Attachment.create_diskfile("test_accentué.txt") do |f|
|
Attachment.create_diskfile("test_accentué.txt") do |f|
|
||||||
|
path = f.path
|
||||||
assert_equal '770c509475505f37c2b8fb6030434d6b.txt', File.basename(f.path)[13..-1]
|
assert_equal '770c509475505f37c2b8fb6030434d6b.txt', File.basename(f.path)[13..-1]
|
||||||
File.unlink f.path
|
|
||||||
end
|
end
|
||||||
|
File.unlink path
|
||||||
|
|
||||||
Attachment.create_diskfile("test_accentué") do |f|
|
Attachment.create_diskfile("test_accentué") do |f|
|
||||||
|
path = f.path
|
||||||
assert_equal 'f8139524ebb8f32e51976982cd20a85d', File.basename(f.path)[13..-1]
|
assert_equal 'f8139524ebb8f32e51976982cd20a85d', File.basename(f.path)[13..-1]
|
||||||
File.unlink f.path
|
|
||||||
end
|
end
|
||||||
|
File.unlink path
|
||||||
|
|
||||||
Attachment.create_diskfile("test_accentué.ça") do |f|
|
Attachment.create_diskfile("test_accentué.ça") do |f|
|
||||||
|
path = f.path
|
||||||
assert_equal 'cbb5b0f30978ba03731d61f9f6d10011', File.basename(f.path)[13..-1]
|
assert_equal 'cbb5b0f30978ba03731d61f9f6d10011', File.basename(f.path)[13..-1]
|
||||||
File.unlink f.path
|
|
||||||
end
|
end
|
||||||
|
File.unlink path
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_title
|
def test_title
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user