Adds a setting to limit the size of text attachments that can be displayed by the file viewer (default set to 512KB). Larger files are sent for download.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2503 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2009-02-21 15:34:11 +00:00
parent 2bd419f23b
commit 66afc8c054
37 changed files with 53 additions and 1 deletions
@@ -53,12 +53,23 @@ class AttachmentsControllerTest < Test::Unit::TestCase
get :show, :id => 5
assert_response :success
assert_template 'diff'
assert_equal 'text/html', @response.content_type
end
def test_show_text_file
get :show, :id => 4
assert_response :success
assert_template 'file'
assert_equal 'text/html', @response.content_type
end
def test_show_text_file_should_send_if_too_big
Setting.setting_file_max_size_displayed = 512
Attachment.find(4).update_attribute :filesize, 754.kilobyte
get :show, :id => 4
assert_response :success
assert_equal 'application/x-ruby', @response.content_type
end
def test_show_other