demarches-normaliennes/spec/mailers/previews/invite_mailer_preview.rb

41 lines
739 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2018-12-20 09:50:20 +01:00
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,
2022-10-06 15:37:51 +02:00
email_sender: 'sender@gouv.fr',
targeted_user_link: targeted_user_link
2018-12-20 09:50:20 +01:00
)
end
2022-10-06 15:37:51 +02:00
def targeted_user_link
TargetedUserLink.new(id: SecureRandom.uuid)
end
2018-12-20 09:50:20 +01:00
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