about summary refs log tree commit diff
path: root/spec/mailers
diff options
context:
space:
mode:
Diffstat (limited to 'spec/mailers')
-rw-r--r--spec/mailers/notification_mailer_spec.rb2
-rw-r--r--spec/mailers/previews/user_mailer_preview.rb5
2 files changed, 6 insertions, 1 deletions
diff --git a/spec/mailers/notification_mailer_spec.rb b/spec/mailers/notification_mailer_spec.rb
index 811435606..1be01e8ba 100644
--- a/spec/mailers/notification_mailer_spec.rb
+++ b/spec/mailers/notification_mailer_spec.rb
@@ -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
diff --git a/spec/mailers/previews/user_mailer_preview.rb b/spec/mailers/previews/user_mailer_preview.rb
index 8d2a9368d..d9cdb9264 100644
--- a/spec/mailers/previews/user_mailer_preview.rb
+++ b/spec/mailers/previews/user_mailer_preview.rb
@@ -34,4 +34,9 @@ class UserMailerPreview < ActionMailer::Preview
   def welcome
     UserMailer.welcome(User.first)
   end
+
+  # Preview this email at http://localhost:3000/rails/mailers/user_mailer/backup_ready
+  def backup_ready
+    UserMailer.backup_ready(User.first, Backup.first)
+  end
 end