mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Remove support for templates with "."
This was previously deprecated in Rails 6.1 (and never quite behaved correctly)
This commit is contained in:
parent
267e1d25dc
commit
85ecf6e409
4 changed files with 4 additions and 17 deletions
|
@ -109,7 +109,6 @@ class RendererTest < ActiveSupport::TestCase
|
|||
xml = "<p>Hello world!</p>\n"
|
||||
|
||||
assert_equal html, render["respond_to/using_defaults"]
|
||||
assert_equal xml, assert_deprecated { render["respond_to/using_defaults.xml.builder"] }
|
||||
assert_equal xml, render["respond_to/using_defaults", formats: :xml]
|
||||
end
|
||||
|
||||
|
|
|
@ -252,7 +252,7 @@ module ActionView
|
|||
|
||||
def find_template_paths_from_details(path, details)
|
||||
if path.name.include?(".")
|
||||
ActiveSupport::Deprecation.warn("Rendering actions with '.' in the name is deprecated: #{path}")
|
||||
return []
|
||||
end
|
||||
|
||||
query = build_query(path, details)
|
||||
|
@ -362,8 +362,7 @@ module ActionView
|
|||
|
||||
def find_template_paths_from_details(path, details)
|
||||
if path.name.include?(".")
|
||||
# Fall back to the unoptimized resolver, which will warn
|
||||
return super
|
||||
return []
|
||||
end
|
||||
|
||||
candidates = find_candidate_template_paths(path)
|
||||
|
|
|
@ -331,13 +331,6 @@ module RenderTestCases
|
|||
assert_equal "Hello: davidHello: mary", @view.render(partial: "test/customer", collection: [ Customer.new("david"), Customer.new("mary") ])
|
||||
end
|
||||
|
||||
def test_render_partial_collection_with_partial_name_containing_dot
|
||||
assert_deprecated do
|
||||
assert_equal "Hello: davidHello: mary",
|
||||
@view.render(partial: "test/customer.mobile", collection: [ Customer.new("david"), Customer.new("mary") ])
|
||||
end
|
||||
end
|
||||
|
||||
def test_render_partial_collection_as_by_string
|
||||
assert_equal "david david davidmary mary mary",
|
||||
@view.render(partial: "test/customer_with_var", collection: [ Customer.new("david"), Customer.new("mary") ], as: "customer")
|
||||
|
|
|
@ -227,13 +227,9 @@ module ResolverSharedTests
|
|||
assert_equal "mobile", templates[0].variant
|
||||
end
|
||||
|
||||
def test_virtual_path_is_preserved_with_dot
|
||||
def test_returns_no_results_with_dot
|
||||
with_file "test/hello_world.html.erb", "Hello html!"
|
||||
|
||||
template = assert_deprecated { context.find("hello_world.html", "test", false, [], {}) }
|
||||
assert_equal "test/hello_world.html", template.virtual_path
|
||||
|
||||
template = context.find("hello_world", "test", false, [], {})
|
||||
assert_equal "test/hello_world", template.virtual_path
|
||||
assert_empty context.find_all("hello_world.html", "test", false, [], {})
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue