Patch #32653

Fix random test failure due to missing call to set_tmp_attachments_directory in WikiControllerTest

Added by Yuichi HARADA 4 months ago. Updated 3 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Code cleanup/refactoring
Target version:4.2.0

Description

For WikiControllerTest#test_update_with_deleted_attachment_ids and WikiControllerTest#test_update_with_deleted_attachment_ids_and_failure_should_preserve_selected_attachments , the files under test/fixtures/files/ may be deleted depending on the test execution order.
Need to call set_tmp_attachments_directory as follows.

diff --git a/test/functional/wiki_controller_test.rb b/test/functional/wiki_controller_test.rb
index e3ac6cb4e..70b892ba5 100644
--- a/test/functional/wiki_controller_test.rb
+++ b/test/functional/wiki_controller_test.rb
@@ -467,6 +467,7 @@ class WikiControllerTest < Redmine::ControllerTest
   end

   def test_update_with_deleted_attachment_ids
+    set_tmp_attachments_directory
     @request.session[:user_id] = 2
     page = WikiPage.find(4)
     attachment = page.attachments.first
@@ -486,6 +487,7 @@ class WikiControllerTest < Redmine::ControllerTest
   end

   def test_update_with_deleted_attachment_ids_and_failure_should_preserve_selected_attachments
+    set_tmp_attachments_directory
     @request.session[:user_id] = 2
     page = WikiPage.find(4)
     attachment = page.attachments.first

Related issues

Related to Redmine - Feature #16410: Bulk delete wiki attachments Closed

Associated revisions

Revision 19406
Added by Go MAEDA 3 months ago

Fix random test failure due to missing call to set_tmp_attachments_directory in WikiControllerTest (#32653).

Patch by Yuichi HARADA.

History

#1 Updated by Go MAEDA 4 months ago

#2 Updated by Go MAEDA 4 months ago

  • Target version set to 4.2.0

Setting the target version to 4.2.0.

#3 Updated by Go MAEDA 3 months ago

  • Subject changed from Fix test failure due to missing call to set_tmp_attachments_directory to Fix random test failure due to missing call to set_tmp_attachments_directory in WikiControllerTest
  • Status changed from New to Closed
  • Assignee set to Go MAEDA

Committed the patch. Thank you for your contribution.

Also available in: Atom PDF