]> source.dussan.org Git - redmine.git/commitdiff
Fixes not to call set_tmp_attachments_directory twice after each test (#32094).
authorGo MAEDA <maeda@farend.jp>
Fri, 20 Sep 2019 01:31:13 +0000 (01:31 +0000)
committerGo MAEDA <maeda@farend.jp>
Fri, 20 Sep 2019 01:31:13 +0000 (01:31 +0000)
Patch by Go MAEDA.

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

test/functional/attachments_controller_test.rb
test/integration/api_test/attachments_test.rb

index f94c73280d7edfafb3234788f9d5af628ebe15ef..ff2838931e4ca46b755a687d08e6c057124b62b0 100644 (file)
@@ -46,7 +46,6 @@ class AttachmentsControllerTest < Redmine::ControllerTest
       assert_select 'th.filename', :text => /issues_controller.rb\t\(révision 1484\)/
       assert_select 'td.line-code', :text => /Demande créée avec succès/
     end
-    set_tmp_attachments_directory
   end
 
   def test_show_diff_replace_cannot_convert_content
@@ -64,7 +63,6 @@ class AttachmentsControllerTest < Redmine::ControllerTest
         assert_select 'td.line-code', :text => /Demande cr\?\?e avec succ\?s/
       end
     end
-    set_tmp_attachments_directory
   end
 
   def test_show_diff_latin_1
@@ -82,7 +80,6 @@ class AttachmentsControllerTest < Redmine::ControllerTest
         assert_select 'td.line-code', :text => /Demande créée avec succès/
       end
     end
-    set_tmp_attachments_directory
   end
 
   def test_show_should_save_diff_type_as_user_preference
@@ -132,7 +129,6 @@ class AttachmentsControllerTest < Redmine::ControllerTest
       }
     assert_response :success
     assert_equal 'text/html', @response.content_type
-    set_tmp_attachments_directory
   end
 
   def test_show_text_file_utf_8
@@ -207,7 +203,6 @@ class AttachmentsControllerTest < Redmine::ControllerTest
       assert_equal 'text/html', @response.content_type
       assert_select '.nodata', :text => 'No preview available. Download the file instead.'
     end
-    set_tmp_attachments_directory
   end
 
   def test_show_image
@@ -227,7 +222,6 @@ class AttachmentsControllerTest < Redmine::ControllerTest
       }
     assert_equal 'text/html', @response.content_type
     assert_select '.nodata', :text => 'No preview available. Download the file instead.'
-    set_tmp_attachments_directory
   end
 
   def test_show_file_from_private_issue_without_permission
@@ -235,7 +229,6 @@ class AttachmentsControllerTest < Redmine::ControllerTest
         :id => 15
       }
     assert_redirected_to '/login?back_url=http%3A%2F%2Ftest.host%2Fattachments%2F15'
-    set_tmp_attachments_directory
   end
 
   def test_show_file_from_private_issue_with_permission
@@ -245,7 +238,6 @@ class AttachmentsControllerTest < Redmine::ControllerTest
       }
     assert_response :success
     assert_select 'h2', :text => /private.diff/
-    set_tmp_attachments_directory
   end
 
   def test_show_file_without_container_should_be_allowed_to_author
@@ -291,8 +283,6 @@ class AttachmentsControllerTest < Redmine::ControllerTest
 
     assert_select 'ul.pages li.next', :text => /next/i
     assert_select 'ul.pages li.previous', :text => /previous/i
-
-    set_tmp_attachments_directory
   end
 
   def test_download_text_file
@@ -309,8 +299,6 @@ class AttachmentsControllerTest < Redmine::ControllerTest
         :id => 4
       }
     assert_response 304
-
-    set_tmp_attachments_directory
   end
 
   def test_download_js_file
@@ -344,7 +332,6 @@ class AttachmentsControllerTest < Redmine::ControllerTest
       }
     assert_response :success
     assert_equal 'text/x-ruby', @response.content_type
-    set_tmp_attachments_directory
   end
 
   def test_download_should_assign_better_content_type_than_application_octet_stream
@@ -355,7 +342,6 @@ class AttachmentsControllerTest < Redmine::ControllerTest
       }
     assert_response :success
     assert_equal 'text/x-ruby', @response.content_type
-    set_tmp_attachments_directory
   end
 
   def test_download_should_assign_application_octet_stream_if_content_type_is_not_determined
@@ -365,7 +351,6 @@ class AttachmentsControllerTest < Redmine::ControllerTest
     assert_response :success
     assert_nil Redmine::MimeType.of(attachments(:attachments_022).filename)
     assert_equal 'application/octet-stream', @response.content_type
-    set_tmp_attachments_directory
   end
 
   def test_download_missing_file
@@ -373,7 +358,6 @@ class AttachmentsControllerTest < Redmine::ControllerTest
         :id => 2
       }
     assert_response 404
-    set_tmp_attachments_directory
   end
 
   def test_download_should_be_denied_without_permission
@@ -381,7 +365,6 @@ class AttachmentsControllerTest < Redmine::ControllerTest
         :id => 7
       }
     assert_redirected_to '/login?back_url=http%3A%2F%2Ftest.host%2Fattachments%2Fdownload%2F7'
-    set_tmp_attachments_directory
   end
 
   if convert_installed?
index f347b396adbfde241f4cefbe68a40e999cea5bdf..af2b397cfaa23c524d84518f2f15fbb334c3622c 100644 (file)
@@ -61,20 +61,17 @@ class Redmine::ApiTest::AttachmentsTest < Redmine::ApiTest::Base
   test "GET /attachments/:id.xml should deny access without credentials" do
     get '/attachments/7.xml'
     assert_response 401
-    set_tmp_attachments_directory
   end
 
   test "GET /attachments/download/:id/:filename should return the attachment content" do
     get '/attachments/download/7/archive.zip', :headers => credentials('jsmith')
     assert_response :success
     assert_equal 'application/zip', @response.content_type
-    set_tmp_attachments_directory
   end
 
   test "GET /attachments/download/:id/:filename should deny access without credentials" do
     get '/attachments/download/7/archive.zip'
     assert_response 401
-    set_tmp_attachments_directory
   end
 
   test "GET /attachments/thumbnail/:id should return the thumbnail" do