Deprecate unused ApplicationHelper#render_if_exist (#39527).

git-svn-id: https://svn.redmine.org/redmine/trunk@22466 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA
2023-11-19 07:41:21 +00:00
parent d6b86ca53d
commit 291d23e5fe
2 changed files with 16 additions and 0 deletions

View File

@@ -2186,14 +2186,26 @@ class ApplicationHelperTest < Redmine::HelperTest
assert_match(/name="new_issue-[a-z0-9]{8}"/, labelled_form_for(Issue.new){})
end
# 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
controller.prepend_view_path "test/fixtures/views"
assert_equal "partial html\n", render_if_exist(:partial => 'partial')
ensure
ActiveSupport::Deprecation.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
controller.prepend_view_path "test/fixtures/views"
assert_nil render_if_exist(:partial => 'non_exist_partial')
ensure
ActiveSupport::Deprecation.behavior = saved_behavior
end
def test_export_csv_encoding_select_tag_should_return_nil_when_general_csv_encoding_is_UTF8