demarches-normaliennes/spec/mailers/previews/devise_user_mailer_preview.rb
Pierre de La Morinerie 6664965961 mailers: add procedure context to the confirmation link
This allows to redirect the user to the procedure they signed up for
even when the browser session is not available (like if they changed
of browser).

Fix #4738
2020-02-25 11:45:36 +00:00

24 lines
696 B
Ruby
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

class DeviseUserMailerPreview < ActionMailer::Preview
def confirmation_instructions
DeviseUserMailer.confirmation_instructions(user, "faketoken", {})
end
def confirmation_instructions___with_procedure
CurrentConfirmation.procedure_after_confirmation = procedure
DeviseUserMailer.confirmation_instructions(user, "faketoken", {})
end
def reset_password_instructions
DeviseUserMailer.reset_password_instructions(user, "faketoken", {})
end
private
def user
User.new(id: 10, email: "usager@example.com")
end
def procedure
Procedure.new(id: 20, libelle: 'Dotation dÉquipement des Territoires Ruraux - Exercice 2019', path: 'dotation-etr')
end
end