mirror of
https://github.com/redmine/redmine.git
synced 2025-10-26 00:36:14 +02:00
Remove deprecated method ApplicationHelper#render_if_exist (#43321).
git-svn-id: https://svn.redmine.org/redmine/trunk@24040 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -1915,20 +1915,6 @@ module ApplicationHelper
|
||||
end
|
||||
end
|
||||
|
||||
def render_if_exist(options = {}, locals = {}, &)
|
||||
# Remove test_render_if_exist_should_be_render_partial and test_render_if_exist_should_be_render_nil
|
||||
# along with this method in Redmine 7.0
|
||||
Rails.application.deprecators[:redmine].warn 'ApplicationHelper#render_if_exist is deprecated and will be removed in Redmine 7.0.'
|
||||
|
||||
if options[:partial]
|
||||
if lookup_context.exists?(options[:partial], lookup_context.prefixes, true)
|
||||
render(options, locals, &)
|
||||
end
|
||||
else
|
||||
render(options, locals, &)
|
||||
end
|
||||
end
|
||||
|
||||
def heads_for_i18n
|
||||
javascript_tag(
|
||||
"rm = window.rm || {};" \
|
||||
|
||||
@@ -2292,28 +2292,6 @@ 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 = 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
|
||||
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 = 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
|
||||
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
|
||||
with_locale 'az' do
|
||||
assert_equal l(:general_csv_encoding), 'UTF-8'
|
||||
|
||||
Reference in New Issue
Block a user