File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -276,27 +276,31 @@ def test_filename_should_be_sanitized
276
276
end
277
277
278
278
def test_create_diskfile
279
+ path = nil
279
280
Attachment . create_diskfile ( "test_file.txt" ) do |f |
280
281
path = f . path
281
282
assert_match ( /^\d {12}_test_file.txt$/ , File . basename ( path ) )
282
283
assert_equal 'test_file.txt' , File . basename ( path ) [ 13 ..-1 ]
283
- File . unlink f . path
284
284
end
285
+ File . unlink path
285
286
286
287
Attachment . create_diskfile ( "test_accentué.txt" ) do |f |
288
+ path = f . path
287
289
assert_equal '770c509475505f37c2b8fb6030434d6b.txt' , File . basename ( f . path ) [ 13 ..-1 ]
288
- File . unlink f . path
289
290
end
291
+ File . unlink path
290
292
291
293
Attachment . create_diskfile ( "test_accentué" ) do |f |
294
+ path = f . path
292
295
assert_equal 'f8139524ebb8f32e51976982cd20a85d' , File . basename ( f . path ) [ 13 ..-1 ]
293
- File . unlink f . path
294
296
end
297
+ File . unlink path
295
298
296
299
Attachment . create_diskfile ( "test_accentué.ça" ) do |f |
300
+ path = f . path
297
301
assert_equal 'cbb5b0f30978ba03731d61f9f6d10011' , File . basename ( f . path ) [ 13 ..-1 ]
298
- File . unlink f . path
299
302
end
303
+ File . unlink path
300
304
end
301
305
302
306
def test_title
You can’t perform that action at this time.
0 commit comments