Failing test for lazy translation in partial with block
This commit is contained in:
parent
be0ab856fc
commit
9e15560191
|
@ -0,0 +1,2 @@
|
|||
<%= t('.foo') %>
|
||||
<%= yield %>
|
1
actionview/test/fixtures/translations/templates/partial_lazy_translation.html.erb
vendored
Normal file
1
actionview/test/fixtures/translations/templates/partial_lazy_translation.html.erb
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
<%= render("translations/templates/partial") %>
|
2
actionview/test/fixtures/translations/templates/partial_lazy_translation_block.html.erb
vendored
Normal file
2
actionview/test/fixtures/translations/templates/partial_lazy_translation_block.html.erb
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
<%= render("translations/templates/partial") do %>
|
||||
<% end %>
|
|
@ -23,7 +23,8 @@ class TranslationHelperTest < ActiveSupport::TestCase
|
|||
found_yield_single_argument: { foo: "Foo" },
|
||||
found_yield_block: { foo: "Foo" },
|
||||
array: { foo: { bar: "Foo Bar" } },
|
||||
default: { foo: "Foo" }
|
||||
default: { foo: "Foo" },
|
||||
partial: { foo: "Partial foo" }
|
||||
},
|
||||
foo: "Foo",
|
||||
hello: "<a>Hello World</a>",
|
||||
|
@ -176,6 +177,14 @@ class TranslationHelperTest < ActiveSupport::TestCase
|
|||
assert_equal "Foo", view.render(template: "translations/templates/found_yield_single_argument").strip
|
||||
end
|
||||
|
||||
def test_finds_lazy_translation_scoped_by_partial
|
||||
assert_equal "Partial foo", view.render(template: "translations/templates/partial_lazy_translation").strip
|
||||
end
|
||||
|
||||
def test_finds_lazy_translation_scoped_by_partial_with_block
|
||||
assert_equal "Partial foo", view.render(template: "translations/templates/partial_lazy_translation_block").strip
|
||||
end
|
||||
|
||||
def test_finds_translation_scoped_by_partial_yielding_translation_and_key
|
||||
assert_equal "translations.templates.found_yield_block.foo: Foo", view.render(template: "translations/templates/found_yield_block").strip
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue