summaryrefslogtreecommitdiffstats
path: root/test/functional/attachments_controller_test.rb
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2019-06-02 23:39:15 +0000
committerGo MAEDA <maeda@farend.jp>2019-06-02 23:39:15 +0000
commitf1c29cdb8c8b6b9526f25321d606f5bfc374c209 (patch)
treea77e5b1d428b4e26d13ac5df7cbc6ede11a1ecf1 /test/functional/attachments_controller_test.rb
parent7f110f72776f4fef85ed66291b9d18a0ac6d1a16 (diff)
downloadredmine-f1c29cdb8c8b6b9526f25321d606f5bfc374c209.tar.gz
redmine-f1c29cdb8c8b6b9526f25321d606f5bfc374c209.zip
Run test only when GhostScript is available (#22481).
Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@18221 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/attachments_controller_test.rb')
-rw-r--r--test/functional/attachments_controller_test.rb24
1 files changed, 14 insertions, 10 deletions
diff --git a/test/functional/attachments_controller_test.rb b/test/functional/attachments_controller_test.rb
index a78403254..f94c73280 100644
--- a/test/functional/attachments_controller_test.rb
+++ b/test/functional/attachments_controller_test.rb
@@ -404,16 +404,6 @@ 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}
@@ -463,6 +453,20 @@ class AttachmentsControllerTest < Redmine::ControllerTest
puts '(ImageMagick convert not available)'
end
+ if gs_installed?
+ 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
+ else
+ puts '(GhostScript convert not available)'
+ end
+
def test_edit_all
@request.session[:user_id] = 2
get :edit_all, :params => {