diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-09-12 10:51:25 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-09-12 10:51:25 +0000 |
commit | 1dbb2562934fa5ead26c1a511e1746d11384da9d (patch) | |
tree | d242f5e944513a921b3bf9e2b66d305f3791e663 /test/unit | |
parent | 672f0e4195581302ffe95663230ad657d519c18b (diff) | |
download | redmine-1dbb2562934fa5ead26c1a511e1746d11384da9d.tar.gz redmine-1dbb2562934fa5ead26c1a511e1746d11384da9d.zip |
Merged r14473 (#20278).
git-svn-id: http://svn.redmine.org/redmine/branches/3.1-stable@14543 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/attachment_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/unit/attachment_test.rb b/test/unit/attachment_test.rb index b48ebcf3f..ffc8fe1cd 100644 --- a/test/unit/attachment_test.rb +++ b/test/unit/attachment_test.rb @@ -327,6 +327,13 @@ class AttachmentTest < ActiveSupport::TestCase set_tmp_attachments_directory end + def test_latest_attach_should_not_error_with_string_with_invalid_encoding + string = "width:50\xFE-Image.jpg".force_encoding('UTF-8') + assert_equal false, string.valid_encoding? + + Attachment.latest_attach(Attachment.limit(2).to_a, string) + end + def test_thumbnailable_should_be_true_for_images assert_equal true, Attachment.new(:filename => 'test.jpg').thumbnailable? end |