From 9842142a9a7a8ca9c0cc96304a56c32fc58eb448 Mon Sep 17 00:00:00 2001 From: maatinito <15379878+maatinito@users.noreply.github.com> Date: Thu, 20 Dec 2018 09:50:20 +0100 Subject: [PATCH] Add InviteMailerPreview --- .../mailers/previews/invite_mailer_preview.rb | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 spec/mailers/previews/invite_mailer_preview.rb diff --git a/spec/mailers/previews/invite_mailer_preview.rb b/spec/mailers/previews/invite_mailer_preview.rb new file mode 100644 index 000000000..f594f2ae8 --- /dev/null +++ b/spec/mailers/previews/invite_mailer_preview.rb @@ -0,0 +1,33 @@ +class InviteMailerPreview < ActionMailer::Preview + def invite_user + InviteMailer.invite_user(invite) + end + + def invite_guest + InviteMailer.invite_guest(invite) + end + + private + + def invite + Invite.new( + id: 10, + dossier: dossier, + user: invited_user, + email: invited_user.email, + email_sender: 'sender@gouv.fr' + ) + end + + def dossier + Dossier.new(procedure: procedure) + end + + def procedure + Procedure.new(libelle: 'Permis de construire en zone inondable') + end + + def invited_user + User.new(email: 'Invité@gouv.fr') + end +end