about summary refs log tree commit diff
path: root/spec
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-03-03 23:45:48 +0100
committerEugen Rochko <eugen@zeonfederated.com>2017-03-04 00:00:48 +0100
commit6b81d100306259cd17b38d3f0f9dec0f0fb5b5d9 (patch)
treea6d40da1644804061eaeacdfd748d027aac2c41b /spec
parentf5457cc3d2be79525d339dd5a5c046de6d0acf9d (diff)
Add digest e-mails
Diffstat (limited to 'spec')
-rw-r--r--spec/mailers/previews/notification_mailer_preview.rb17
1 files changed, 12 insertions, 5 deletions
diff --git a/spec/mailers/previews/notification_mailer_preview.rb b/spec/mailers/previews/notification_mailer_preview.rb
index 8fc8d0d34..a08a80d17 100644
--- a/spec/mailers/previews/notification_mailer_preview.rb
+++ b/spec/mailers/previews/notification_mailer_preview.rb
@@ -1,24 +1,31 @@
 # Preview all emails at http://localhost:3000/rails/mailers/notification_mailer
 class NotificationMailerPreview < ActionMailer::Preview
-
   # Preview this email at http://localhost:3000/rails/mailers/notification_mailer/mention
   def mention
-    # NotificationMailer.mention
+    m = Mention.last
+    NotificationMailer.mention(m.account, Notification.find_by(activity: m))
   end
 
   # Preview this email at http://localhost:3000/rails/mailers/notification_mailer/follow
   def follow
-    # NotificationMailer.follow
+    f = Follow.last
+    NotificationMailer.follow(f.target_account, Notification.find_by(activity: f))
   end
 
   # Preview this email at http://localhost:3000/rails/mailers/notification_mailer/favourite
   def favourite
-    # NotificationMailer.favourite
+    f = Favourite.last
+    NotificationMailer.favourite(f.status.account, Notification.find_by(activity: f))
   end
 
   # Preview this email at http://localhost:3000/rails/mailers/notification_mailer/reblog
   def reblog
-    # NotificationMailer.reblog
+    r = Status.where.not(reblog_of_id: nil).first
+    NotificationMailer.reblog(r.reblog.account, Notification.find_by(activity: r))
   end
 
+  # Preview this email at http://localhost:3000/rails/mailers/notification_mailer/digest
+  def digest
+    NotificationMailer.digest(Account.first, since: 90.days.ago)
+  end
 end