prix-fixe

Expand History Expand History
Collapse History Collapse History

Use FormBuilder to internationalize labels

When the system test is modified to translate other keys, the test fails:

Error:
UserSharesAMessageTest#test_visiting_the_index:
I18n::MissingTranslationData: translation missing: en.helpers.label.note.content
    test/system/user_shares_a_message_test.rb:9:in `block in <class:UserSharesAMessageTest>'

The key structure for this value is not arbitrary: it adheres to the conventions for Rails’ ActionView::Helpers::FormBuilder#label resolution API.

When we declare the corresponding internationalization keys, the system tests pass.

Finally, we can remove the String arguments from the notes#new template’s helper method calls to rely on the internationalization behavior.