File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
spec/mailers/previews/better_together Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ # frozen_string_literal: true
2+
3+ module BetterTogether
4+ # Preview at /rails/mailers/better_together/authorship_mailer
5+ class AuthorshipMailerPreview < ActionMailer ::Preview
6+ include FactoryBot ::Syntax ::Methods
7+ include BetterTogether ::ApplicationHelper
8+
9+ # Preview this email at
10+ # /rails/mailers/better_together/authorship_mailer/authorship_changed_notification
11+ def authorship_changed_notification
12+ host_platform || create ( :platform , :host )
13+
14+ actor = create ( :user , :confirmed )
15+ recipient = create ( :user , :confirmed )
16+ # Use build to avoid Elasticsearch callbacks on BetterTogether::Page
17+ page = build ( :page )
18+
19+ BetterTogether ::AuthorshipMailer
20+ . with ( page : page ,
21+ recipient : recipient . person ,
22+ action : 'added' ,
23+ actor_name : actor . person . name )
24+ . authorship_changed_notification
25+ end
26+ end
27+ end
You can’t perform that action at this time.
0 commit comments