summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-05-08 08:04:51 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-05-08 08:04:51 +0000
commitb553b23e6b9d712d9c1168cbb167a2bbfd9ec088 (patch)
tree8e6a59e4dba0c32eac4e13ef37023abdd595199c /test
parent3d2c198c0f889e73ae2a16a068c41948b40cefff (diff)
downloadredmine-b553b23e6b9d712d9c1168cbb167a2bbfd9ec088.tar.gz
redmine-b553b23e6b9d712d9c1168cbb167a2bbfd9ec088.zip
Show attachment view even is no preview is available (#22482).
Patch by Gregor Schmidt. git-svn-id: http://svn.redmine.org/redmine/trunk@15398 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/functional/attachments_controller_test.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/test/functional/attachments_controller_test.rb b/test/functional/attachments_controller_test.rb
index 397be850c..5d3387975 100644
--- a/test/functional/attachments_controller_test.rb
+++ b/test/functional/attachments_controller_test.rb
@@ -179,12 +179,13 @@ class AttachmentsControllerTest < ActionController::TestCase
end
end
- def test_show_text_file_should_send_if_too_big
+ def test_show_text_file_should_show_other_if_too_big
with_settings :file_max_size_displayed => 512 do
Attachment.find(4).update_attribute :filesize, 754.kilobyte
get :show, :id => 4
assert_response :success
- assert_equal 'application/x-ruby', @response.content_type
+ assert_template 'other'
+ assert_equal 'text/html', @response.content_type
end
set_tmp_attachments_directory
end
@@ -200,8 +201,9 @@ class AttachmentsControllerTest < ActionController::TestCase
def test_show_other
get :show, :id => 6
- assert_response :success
- assert_equal 'application/zip', @response.content_type
+ assert_template 'other'
+ assert_equal 'text/html', @response.content_type
+ assert_select '.nodata', :text => 'No preview available'
set_tmp_attachments_directory
end