diff options
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/attachments_controller_test.rb | 11 |
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 |