]> source.dussan.org Git - redmine.git/commitdiff
Add basic test for image view (#22482).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 8 May 2016 07:40:59 +0000 (07:40 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 8 May 2016 07:40:59 +0000 (07:40 +0000)
Patch by Gregor Schmidt.

git-svn-id: http://svn.redmine.org/redmine/trunk@15396 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/functional/attachments_controller_test.rb

index 566009abf2cd016f1ecff2153098781747aeee87..397be850ccbafcfcfa6fa40a16e52913c0e4d73e 100644 (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