]> source.dussan.org Git - redmine.git/commitdiff
scm: filesystem: add test for displaying file over max size limit (#6256).
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Tue, 22 Mar 2011 15:33:33 +0000 (15:33 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Tue, 22 Mar 2011 15:33:33 +0000 (15:33 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5207 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/functional/repositories_filesystem_controller_test.rb

index e816115dca3bf803d6f51e7f6fb3eb34b9a84ec7..706675fb79accb509239556d8a6c36b58af73945 100644 (file)
@@ -87,6 +87,15 @@ class RepositoriesFilesystemControllerTest < ActionController::TestCase
                    :sibling => { :tag => 'td', :content => /japanese/ }
       end
     end
+
+    def test_show_text_file_should_send_if_too_big
+      with_settings :file_max_size_displayed => 1 do
+        get :entry, :id => PRJ_ID, :path => ['japanese', 'big-file.txt']
+        assert_response :success
+        # TODO: 'image/png'
+        assert_equal 'application/octet-stream', @response.content_type
+      end
+    end
   else
     puts "Filesystem test repository NOT FOUND. Skipping functional tests !!!"
     def test_fake; assert true end