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}
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 => {
self.class.convert_installed?
end
+ def self.gs_installed?
+ Redmine::Thumbnail.gs_available?
+ end
+
+ def gs_installed?
+ self.class.gs_installed?
+ end
+
# Returns the path to the test +vendor+ repository
def self.repository_path(vendor)
path = Rails.root.join("tmp/test/#{vendor.downcase}_repository").to_s