mirror of
https://github.com/redmine/redmine.git
synced 2025-12-16 05:20:28 +01:00
fix source indent of AttachmentTest
git-svn-id: http://svn.redmine.org/redmine/trunk@20209 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -398,12 +398,15 @@ class AttachmentTest < ActiveSupport::TestCase
|
|||||||
|
|
||||||
def test_update_attachments
|
def test_update_attachments
|
||||||
attachments = Attachment.where(:id => [2, 3]).to_a
|
attachments = Attachment.where(:id => [2, 3]).to_a
|
||||||
|
assert(
|
||||||
assert Attachment.update_attachments(attachments, {
|
Attachment.update_attachments(
|
||||||
'2' => {:filename => 'newname.txt', :description => 'New description'},
|
attachments,
|
||||||
3 => {:filename => 'othername.txt'}
|
{
|
||||||
})
|
'2' => {:filename => 'newname.txt', :description => 'New description'},
|
||||||
|
3 => {:filename => 'othername.txt'}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
attachment = Attachment.find(2)
|
attachment = Attachment.find(2)
|
||||||
assert_equal 'newname.txt', attachment.filename
|
assert_equal 'newname.txt', attachment.filename
|
||||||
assert_equal 'New description', attachment.description
|
assert_equal 'New description', attachment.description
|
||||||
@@ -414,23 +417,29 @@ class AttachmentTest < ActiveSupport::TestCase
|
|||||||
|
|
||||||
def test_update_attachments_with_failure
|
def test_update_attachments_with_failure
|
||||||
attachments = Attachment.where(:id => [2, 3]).to_a
|
attachments = Attachment.where(:id => [2, 3]).to_a
|
||||||
|
assert(
|
||||||
assert !Attachment.update_attachments(attachments, {
|
!Attachment.update_attachments(
|
||||||
'2' => {:filename => '', :description => 'New description'},
|
attachments,
|
||||||
3 => {:filename => 'othername.txt'}
|
{
|
||||||
})
|
'2' => {
|
||||||
|
:filename => '', :description => 'New description'
|
||||||
|
},
|
||||||
|
3 => {:filename => 'othername.txt'}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
attachment = Attachment.find(3)
|
attachment = Attachment.find(3)
|
||||||
assert_equal 'logo.gif', attachment.filename
|
assert_equal 'logo.gif', attachment.filename
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_update_attachments_should_sanitize_filename
|
def test_update_attachments_should_sanitize_filename
|
||||||
attachments = Attachment.where(:id => 2).to_a
|
attachments = Attachment.where(:id => 2).to_a
|
||||||
|
assert(
|
||||||
assert Attachment.update_attachments(attachments, {
|
Attachment.update_attachments(
|
||||||
2 => {:filename => 'newname?.txt'},
|
attachments,
|
||||||
})
|
{2 => {:filename => 'newname?.txt'},}
|
||||||
|
)
|
||||||
|
)
|
||||||
attachment = Attachment.find(2)
|
attachment = Attachment.find(2)
|
||||||
assert_equal 'newname_.txt', attachment.filename
|
assert_equal 'newname_.txt', attachment.filename
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user