Skip thumbnail tests if ImageMagick convert command is not available (#33226).

Patch by Pavel Rosický.


git-svn-id: http://svn.redmine.org/redmine/trunk@19640 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA
2020-04-02 08:04:15 +00:00
parent 0f3cece5bb
commit a24834fa77
5 changed files with 5 additions and 1 deletions

View File

@@ -155,7 +155,7 @@ class GanttsControllerTest < Redmine::ControllerTest
assert @response.body.starts_with?('%PDF') assert @response.body.starts_with?('%PDF')
end end
if Object.const_defined?(:MiniMagick) if Object.const_defined?(:MiniMagick) && convert_installed?
def test_gantt_should_export_to_png def test_gantt_should_export_to_png
get :show, :params => { get :show, :params => {
:project_id => 1, :project_id => 1,

View File

@@ -2542,6 +2542,7 @@ class IssuesControllerTest < Redmine::ControllerTest
end end
def test_show_with_thumbnails_enabled_should_display_thumbnails def test_show_with_thumbnails_enabled_should_display_thumbnails
skip unless convert_installed?
@request.session[:user_id] = 2 @request.session[:user_id] = 2
with_settings :thumbnails_enabled => '1' do with_settings :thumbnails_enabled => '1' do
get(:show, :params => {:id => 14}) get(:show, :params => {:id => 14})

View File

@@ -32,6 +32,7 @@ class JournalsHelperTest < Redmine::HelperTest
:versions :versions
def test_journal_thumbnail_attachments_should_return_thumbnailable_attachments def test_journal_thumbnail_attachments_should_return_thumbnailable_attachments
skip unless convert_installed?
set_tmp_attachments_directory set_tmp_attachments_directory
issue = Issue.generate! issue = Issue.generate!

View File

@@ -50,6 +50,7 @@ class Redmine::ApiTest::AttachmentsTest < Redmine::ApiTest::Base
end end
test "GET /attachments/:id.xml for image should include thumbnail_url" do test "GET /attachments/:id.xml for image should include thumbnail_url" do
skip unless convert_installed?
get '/attachments/16.xml', :headers => credentials('jsmith') get '/attachments/16.xml', :headers => credentials('jsmith')
assert_response :success assert_response :success
assert_equal 'application/xml', @response.media_type assert_equal 'application/xml', @response.media_type

View File

@@ -444,6 +444,7 @@ class AttachmentTest < ActiveSupport::TestCase
end end
def test_thumbnailable_should_be_true_for_images def test_thumbnailable_should_be_true_for_images
skip unless convert_installed?
assert_equal true, Attachment.new(:filename => 'test.jpg').thumbnailable? assert_equal true, Attachment.new(:filename => 'test.jpg').thumbnailable?
end end