]> cat aescling's git repositories - mastodon.git/commitdiff
Limit the languages used for notification mailer test (#6487)
authorAkihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
Sat, 17 Feb 2018 13:27:51 +0000 (22:27 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Sat, 17 Feb 2018 13:27:51 +0000 (14:27 +0100)
Some available languages lack translations for notification mails. Now it
tests for two languages which is certain to have required translations:
German and English.

German is the language the current project owner, Eugen Rochko speaks, and
providing English translations for new messages is de facto mandatory.

spec/mailers/notification_mailer_spec.rb

index 8114356060235d48b3fbbd9981fd553bf674379d..1be01e8baa16f8b924fbb8d96700df3d5d9c93e5 100644 (file)
@@ -8,7 +8,7 @@ RSpec.describe NotificationMailer, type: :mailer do
 
   shared_examples 'localized subject' do |*args, **kwrest|
     it 'renders subject localized for the locale of the receiver' do
-      locale = I18n.available_locales.sample
+      locale = %i(de en).sample
       receiver.update!(locale: locale)
       expect(mail.subject).to eq I18n.t(*args, kwrest.merge(locale: locale))
     end