ensure normalize_name is operating on a string
This commit is contained in:
parent
8b5ebb4132
commit
63c32e9eda
@ -194,6 +194,7 @@ def detail_args_for_any
|
||||
|
||||
# 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
|
||||
|
||||
|
@ -149,6 +149,10 @@ def test_render_ruby_template_inline
|
||||
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")
|
||||
|
Loading…
Reference in New Issue
Block a user