FIX: Failed to save email template with pluralized subject

This commit is contained in:
Gerhard Schlager
2019-03-06 16:49:40 +01:00
parent 5cf63e43c6
commit 4000978452
2 changed files with 20 additions and 2 deletions

View File

@@ -214,6 +214,21 @@ RSpec.describe Admin::EmailTemplatesController do
end
end
context "when subject has plural keys" do
it "doesn't update the subject" do
old_subject = I18n.t('system_messages.pending_users_reminder.subject_template')
expect(old_subject).to be_a(Hash)
put '/admin/customize/email_templates/system_messages.pending_users_reminder', params: {
email_template: { subject: '', body: 'Lorem ipsum' }
}, headers: headers
expect(response.status).to eq(200)
expect(I18n.t('system_messages.pending_users_reminder.subject_template')).to eq(old_subject)
expect(I18n.t('system_messages.pending_users_reminder.text_body_template')).to eq('Lorem ipsum')
end
end
end
end