summaryrefslogtreecommitdiffstats
path: root/test/functional
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2009-02-21 15:34:11 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2009-02-21 15:34:11 +0000
commit66afc8c054f2b1e7253d9e96d60622d6040bf48d (patch)
tree6022ebc6d124b2bb7b95691b2b7a3648c6925b01 /test/functional
parent2bd419f23b42dc08ad29ba9fc9ecdbfa003587f3 (diff)
downloadredmine-66afc8c054f2b1e7253d9e96d60622d6040bf48d.tar.gz
redmine-66afc8c054f2b1e7253d9e96d60622d6040bf48d.zip
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
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/attachments_controller_test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/functional/attachments_controller_test.rb b/test/functional/attachments_controller_test.rb
index 43650bdfd..0639de8d9 100644
--- a/test/functional/attachments_controller_test.rb
+++ b/test/functional/attachments_controller_test.rb
@@ -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