Add basic test for image view (#22482).

Patch by Gregor Schmidt.

git-svn-id: http://svn.redmine.org/redmine/trunk@15396 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2016-05-08 07:40:59 +00:00
parent 690b1e9cb7
commit d8d23fbb6b

View File

@@ -189,6 +189,15 @@ class AttachmentsControllerTest < ActionController::TestCase
set_tmp_attachments_directory
end
def test_show_image
@request.session[:user_id] = 2
get :show, :id => 16
assert_response :success
assert_template 'image'
assert_equal 'text/html', @response.content_type
assert_select 'img.filecontent', :src => attachments(:attachments_010).filename
end
def test_show_other
get :show, :id => 6
assert_response :success