summaryrefslogtreecommitdiffstats
path: root/test/functional/repositories_git_controller_test.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-11-05 03:47:03 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-11-05 03:47:03 +0000
commit4ae7f82f3ae13ff01d1581f2a8f271ff294e06be (patch)
tree68df52c8c116441c0fa7e7bc9c5c4a1a582480da /test/functional/repositories_git_controller_test.rb
parentae086b5ef60fd0b71a144e542b70acfa4644527a (diff)
downloadredmine-4ae7f82f3ae13ff01d1581f2a8f271ff294e06be.tar.gz
redmine-4ae7f82f3ae13ff01d1581f2a8f271ff294e06be.zip
do not annotate text files which exceed the size limit for viewing (#9484)
Contributed by Antonio García-Domínguez. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7728 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/repositories_git_controller_test.rb')
-rw-r--r--test/functional/repositories_git_controller_test.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/functional/repositories_git_controller_test.rb b/test/functional/repositories_git_controller_test.rb
index 5eea1d4f7..0a95cbeef 100644
--- a/test/functional/repositories_git_controller_test.rb
+++ b/test/functional/repositories_git_controller_test.rb
@@ -354,6 +354,19 @@ class RepositoriesGitControllerTest < ActionController::TestCase
:content => /cannot be annotated/
end
+ def test_annotate_error_when_too_big
+ with_settings :file_max_size_displayed => 1 do
+ get :annotate, :id => PRJ_ID, :path => ['sources', 'watchers_controller.rb'], :rev => 'deff712f'
+ assert_response 500
+ assert_tag :tag => 'p', :attributes => { :id => /errorExplanation/ },
+ :content => /exceeds the maximum text file size/
+
+ get :annotate, :id => PRJ_ID, :path => ['README'], :rev => '7234cb2'
+ assert_response :success
+ assert_template 'annotate'
+ end
+ end
+
def test_annotate_latin_1
if @ruby19_non_utf8_pass
puts_ruby19_non_utf8_pass()