1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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.
This commit is contained in:
Yves Senn 2014-02-24 19:31:23 +01:00
parent f2577ca89f
commit 947b3cbaa2

View file

@ -2391,15 +2391,13 @@ class FormHelperTest < ActionView::TestCase
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