]> source.dussan.org Git - redmine.git/commitdiff
Fix deprecation warnings regarding the use of ActiveSupport::Deprecation.behavior...
authorGo MAEDA <maeda@farend.jp>
Fri, 1 Dec 2023 06:59:04 +0000 (06:59 +0000)
committerGo MAEDA <maeda@farend.jp>
Fri, 1 Dec 2023 06:59:04 +0000 (06:59 +0000)
git-svn-id: https://svn.redmine.org/redmine/trunk@22493 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/helpers/application_helper_test.rb

index 7387487f2661f1dec861fe64df2e2d70b1b393cb..8dccb8b7eaf65d022c708f8e132e2ecfd2df5d6a 100644 (file)
@@ -2188,24 +2188,24 @@ class ApplicationHelperTest < Redmine::HelperTest
 
   # TODO: Remove this test when ApplicationHelper#render_if_exist is removed
   def test_render_if_exist_should_be_render_partial
-    saved_behavior = ActiveSupport::Deprecation.behavior
-    ActiveSupport::Deprecation.behavior = :silence
+    saved_behavior = Rails.application.deprecators[:active_support].behavior
+    Rails.application.deprecators[:active_support].behavior = :silence
 
     controller.prepend_view_path "test/fixtures/views"
     assert_equal "partial html\n", render_if_exist(:partial => 'partial')
   ensure
-    ActiveSupport::Deprecation.behavior = saved_behavior
+    Rails.application.deprecators[:active_support].behavior = saved_behavior
   end
 
   # TODO: Remove this test when ApplicationHelper#render_if_exist is removed
   def test_render_if_exist_should_be_render_nil
-    saved_behavior = ActiveSupport::Deprecation.behavior
-    ActiveSupport::Deprecation.behavior = :silence
+    saved_behavior = Rails.application.deprecators[:active_support].behavior
+    Rails.application.deprecators[:active_support].behavior = :silence
 
     controller.prepend_view_path "test/fixtures/views"
     assert_nil render_if_exist(:partial => 'non_exist_partial')
   ensure
-    ActiveSupport::Deprecation.behavior = saved_behavior
+    Rails.application.deprecators[:active_support].behavior = saved_behavior
   end
 
   def test_export_csv_encoding_select_tag_should_return_nil_when_general_csv_encoding_is_UTF8