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

36 lines
1 KiB
Ruby
Raw Normal View History

class AdministrationMailerPreview < ActionMailer::Preview
def dubious_procedures
procedures_and_champs = [
[procedure_1, [TypeDeChamp.new(libelle: 'iban'), TypeDeChamp.new(libelle: 'religion')]],
[procedure_2, [TypeDeChamp.new(libelle: 'iban'), TypeDeChamp.new(libelle: 'numéro de carte bleu')]]
]
AdministrationMailer.dubious_procedures(procedures_and_champs)
end
2018-01-24 18:15:06 +01:00
def invite_admin
AdministrationMailer.invite_admin(administrateur, "12345678", 0)
2018-01-24 18:15:06 +01:00
end
def invite_admin_whose_already_has_an_account
AdministrationMailer.invite_admin(administrateur, nil, 0)
end
def refuse_admin
AdministrationMailer.refuse_admin('bad_admin@pipo.com')
end
2018-12-20 16:46:44 +01:00
private
def procedure_1
Procedure.new(id: 10, libelle: "Démarche des marches", administrateurs: [administrateur])
2018-12-20 16:46:44 +01:00
end
def procedure_2
Procedure.new(id: 20, libelle: "Démarche pieds", administrateurs: [administrateur])
2018-12-20 16:46:44 +01:00
end
def administrateur
2020-02-03 11:09:54 +01:00
Administrateur.new(id: 111, user: User.new(email: "chef.de.service@administration.gouv.fr"))
2018-12-20 16:46:44 +01:00
end
end