Patch by Go MAEDA.
git-svn-id: http://svn.redmine.org/redmine/trunk@18885
e93f8b46-1217-0410-a6f0-
8f06a7374b81
end
def thumbnailable?
- image? || (is_pdf? && Redmine::Thumbnail.gs_available?)
+ Redmine::Thumbnail.convert_available? && (
+ image? || (is_pdf? && Redmine::Thumbnail.gs_available?)
+ )
end
# Returns the full path the attachment thumbnail, or nil
assert_equal true, Attachment.new(:filename => 'test.jpg').thumbnailable?
end
- def test_thumbnailable_should_be_true_for_non_images
+ def test_thumbnailable_should_be_false_for_images_if_convert_is_unavailable
+ Redmine::Thumbnail.stubs(:convert_available?).returns(false)
+ assert_equal false, Attachment.new(:filename => 'test.jpg').thumbnailable?
+ end
+
+ def test_thumbnailable_should_be_false_for_non_images
assert_equal false, Attachment.new(:filename => 'test.txt').thumbnailable?
end