Test for r18158 (#22481).

Patch by Go MAEDA.


git-svn-id: http://svn.redmine.org/redmine/trunk@18159 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA
2019-05-12 05:43:50 +00:00
parent c4a4133178
commit 96b6bdfb77
4 changed files with 40 additions and 5 deletions

View File

@@ -404,6 +404,16 @@ class AttachmentsControllerTest < Redmine::ControllerTest
assert_response 304
end
def test_thumbnail_for_pdf_should_be_png
Attachment.clear_thumbnails
@request.session[:user_id] = 2
get :thumbnail, :params => {
:id => 23 # ecookbook-gantt.pdf
}
assert_response :success
assert_equal 'image/png', response.content_type
end
def test_thumbnail_should_not_exceed_maximum_size
Redmine::Thumbnail.expects(:generate).with {|source, target, size| size == 800}