mailer_preview: improve data used for generating previews
This commit is contained in:
parent
5bafda6619
commit
44574b2b93
1 changed files with 16 additions and 3 deletions
|
@ -1,7 +1,7 @@
|
|||
# Preview all emails at http://localhost:3000/rails/mailers/dossier_mailer
|
||||
class DossierMailerPreview < ActionMailer::Preview
|
||||
def notify_new_draft
|
||||
DossierMailer.notify_new_draft(dossier)
|
||||
DossierMailer.notify_new_draft(draft)
|
||||
end
|
||||
|
||||
def notify_new_answer
|
||||
|
@ -26,11 +26,24 @@ class DossierMailerPreview < ActionMailer::Preview
|
|||
DeletedDossier.new(dossier_id: 1, procedure: procedure)
|
||||
end
|
||||
|
||||
def draft
|
||||
Dossier.new(id: 47882, procedure: procedure, user: User.new(email: "usager@example.com"))
|
||||
end
|
||||
|
||||
def dossier
|
||||
Dossier.new(id: 1, procedure: procedure, user: User.new(email: "usager@example.com"))
|
||||
Dossier.new(id: 47882, state: :en_instruction, procedure: procedure, user: User.new(email: "usager@example.com"))
|
||||
end
|
||||
|
||||
def procedure
|
||||
Procedure.new(libelle: 'Démarche pour des marches')
|
||||
Procedure.new(libelle: 'Dotation d’Équipement des Territoires Ruraux - Exercice 2019', service: service, logo: Rack::Test::UploadedFile.new("./spec/fixtures/files/logo_test_procedure.png", 'image/png'))
|
||||
end
|
||||
|
||||
def service
|
||||
Service.new(
|
||||
nom: 'Direction du Territoire des Vosges',
|
||||
email: 'prms@ddt.vosges.gouv.fr',
|
||||
telephone: '01 34 22 33 85',
|
||||
horaires: 'Du lundi au vendredi, de 9 h à 18 h'
|
||||
)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue