ensure normalize_name is operating on a string

This commit is contained in:
Keeran Raj Hawoldar 2021-05-12 18:06:04 +01:00
parent 8b5ebb4132
commit 63c32e9eda
2 changed files with 5 additions and 0 deletions

View File

@ -194,6 +194,7 @@ module ActionView
# Fix when prefix is specified as part of the template name
def normalize_name(name, prefixes)
name = name.to_s
idx = name.rindex("/")
return name, prefixes.presence || [""] unless idx

View File

@ -149,6 +149,10 @@ module RenderTestCases
assert_equal "4", @view.render(inline: "(2**2).to_s", type: :ruby)
end
def test_render_template_via_symbol_lookup
assert_equal "Hello from Ruby code", @view.render(template: :ruby_template)
end
def test_render_template_with_localization_on_context_level
old_locale, @view.locale = @view.locale, :da
assert_equal "Hey verden", @view.render(template: "test/hello_world")