From 18ad5e8e5e73eab860d35c4f8d741e100b2a4b34 Mon Sep 17 00:00:00 2001 From: Maciej Szlosarczyk Date: Wed, 11 Apr 2018 09:39:24 +0300 Subject: [PATCH] Fix missing translation error --- app/views/admin/mail_templates/_form.haml | 4 ++-- app/views/admin/mail_templates/new.haml | 2 +- config/locales/admin/mail_templates.en.yml | 5 +++++ config/locales/en.yml | 1 - test/integration/admin/mail_templates/new_test.rb | 14 ++++++++++++++ 5 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 config/locales/admin/mail_templates.en.yml create mode 100644 test/integration/admin/mail_templates/new_test.rb diff --git a/app/views/admin/mail_templates/_form.haml b/app/views/admin/mail_templates/_form.haml index 739cce665..70873c22a 100644 --- a/app/views/admin/mail_templates/_form.haml +++ b/app/views/admin/mail_templates/_form.haml @@ -37,7 +37,7 @@ = f.email_field :bcc, class: 'form-control' .form-group .col-md-12 - = f.label :body, t(:html_body) + = f.label :body, t('admin.mail_templates.html_body') = liquid_help .col-md-12 = f.text_area(:body, class: 'form-control', size: '15x15') @@ -48,7 +48,7 @@ .col-md-12 = f.text_area(:text_body, class: 'form-control', size: '15x15') - %hr + %hr .row .col-md-12.text-right = button_tag(t(:save), class: 'btn btn-primary') diff --git a/app/views/admin/mail_templates/new.haml b/app/views/admin/mail_templates/new.haml index e5889e2b3..ecf2ea1e8 100644 --- a/app/views/admin/mail_templates/new.haml +++ b/app/views/admin/mail_templates/new.haml @@ -1,3 +1,3 @@ -= render 'shared/title', name: t(:new_mail_template) += render 'shared/title', name: t('admin.mail_templates.new_mail_template') = render 'form', mail_template: @mail_template diff --git a/config/locales/admin/mail_templates.en.yml b/config/locales/admin/mail_templates.en.yml new file mode 100644 index 000000000..2aa6ad52d --- /dev/null +++ b/config/locales/admin/mail_templates.en.yml @@ -0,0 +1,5 @@ +en: + admin: + mail_templates: + html_body: HTML body + new_mail_template: New mail template diff --git a/config/locales/en.yml b/config/locales/en.yml index 1e65f7e29..265293de1 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -731,7 +731,6 @@ en: is_registrant: 'Is registrant' force_delete_set_on_domain: 'Force delete set on domain %{domain_name}' mail_templates: Mail Templates - new_mail_template: New mail template failure: "It was not saved" contact_is_not_valid: 'Contact %{value} is not valid, please fix the invalid contact' welcome_to_eis_registrar_portal: 'Welcome to EIS Registrar portal' diff --git a/test/integration/admin/mail_templates/new_test.rb b/test/integration/admin/mail_templates/new_test.rb new file mode 100644 index 000000000..c7b9dff41 --- /dev/null +++ b/test/integration/admin/mail_templates/new_test.rb @@ -0,0 +1,14 @@ +require 'test_helper' + +class AdminAreaNewMailTemplateTest < ActionDispatch::IntegrationTest + def setup + login_as users(:admin) + end + + def test_new_mail_template_does_not_throw_template_error + visit admin_mail_templates_url + click_link_or_button 'New' + assert_text "HTML body" + assert_text "New mail template" + end +end