From 821c91a74a026c70c9c4adfb2a3ff77d4ed98435 Mon Sep 17 00:00:00 2001 From: Gregor Schmidt Date: Wed, 13 Apr 2016 12:53:55 +0200 Subject: [PATCH 1/5] Add basic test for image view (#22058) --- test/functional/attachments_controller_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/functional/attachments_controller_test.rb b/test/functional/attachments_controller_test.rb index 566009a..c0560aa 100644 --- a/test/functional/attachments_controller_test.rb +++ b/test/functional/attachments_controller_test.rb @@ -189,6 +189,14 @@ 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 -- 2.8.0