提交 947b3cba 编写于 作者: Y Yves Senn

refactor, with_locale is not needed because I18n is mocked.

This is a follow up to #14170. While backporting I recognized
that this call is not needed at all.
上级 f2577ca8
......@@ -2391,15 +2391,13 @@ def test_nested_fields_for_arel_like
end
def test_nested_fields_label_translation_with_more_than_10_records
with_locale(:locale) do
@post.comments = Array.new(11) { |id| Comment.new(id + 1) }
@post.comments = Array.new(11) { |id| Comment.new(id + 1) }
I18n.expects(:t).with('post.comments.body', default: [:"comment.body", ''], scope: "helpers.label").times(11).returns "Write body here"
I18n.expects(:t).with('post.comments.body', default: [:"comment.body", ''], scope: "helpers.label").times(11).returns "Write body here"
form_for(@post) do |f|
f.fields_for(:comments) do |cf|
concat cf.label(:body)
end
form_for(@post) do |f|
f.fields_for(:comments) do |cf|
concat cf.label(:body)
end
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册