##// END OF EJS Templates
Show repository images inline when clicking 'View' (#10362)....
Jean-Philippe Lang -
r9593:234e5d59acf4
parent child
Show More
@@ -176,6 +176,7 class RepositoriesController < ApplicationController
176 176 send_opt = { :filename => filename_for_content_disposition(@path.split('/').last) }
177 177 send_type = Redmine::MimeType.of(@path)
178 178 send_opt[:type] = send_type.to_s if send_type
179 send_opt[:disposition] = (Redmine::MimeType.is_type?('image', @path) && !is_raw ? 'inline' : 'attachment')
179 180 send_data @content, send_opt
180 181 else
181 182 # Prevent empty lines when displaying a file with Windows style eol
@@ -185,6 +185,13 class RepositoriesSubversionControllerTest < ActionController::TestCase
185 185 end
186 186 end
187 187
188 def test_entry_should_send_images_inline
189 get :entry, :id => PRJ_ID,
190 :path => repository_path_hash(['subversion_test', 'folder', 'subfolder', 'rubylogo.gif'])[:param]
191 assert_response :success
192 assert_equal 'inline; filename="rubylogo.gif"', response.headers['Content-Disposition']
193 end
194
188 195 def test_entry_at_given_revision
189 196 assert_equal 0, @repository.changesets.count
190 197 @repository.fetch_changesets
General Comments 0
You need to be logged in to leave comments. Login now