Add previews for all customized Devise emails

This commit is contained in:
Robert Speicher 2016-05-25 17:53:26 -04:00
parent 933cd3478d
commit 7b66dcf65e

View file

@ -1,11 +1,30 @@
class DeviseMailerPreview < ActionMailer::Preview class DeviseMailerPreview < ActionMailer::Preview
def confirmation_instructions_for_signup def confirmation_instructions_for_signup
user = User.new(name: 'Jane Doe', email: 'signup@example.com') DeviseMailer.confirmation_instructions(unsaved_user, 'faketoken', {})
DeviseMailer.confirmation_instructions(user, 'faketoken', {})
end end
def confirmation_instructions_for_new_email def confirmation_instructions_for_new_email
user = User.last user = User.last
user.unconfirmed_email = 'unconfirmed@example.com'
DeviseMailer.confirmation_instructions(user, 'faketoken', {}) DeviseMailer.confirmation_instructions(user, 'faketoken', {})
end end
def reset_password_instructions
DeviseMailer.reset_password_instructions(unsaved_user, 'faketoken', {})
end
def unlock_instructions
DeviseMailer.unlock_instructions(unsaved_user, 'faketoken', {})
end
def password_change
DeviseMailer.password_change(unsaved_user, {})
end
private
def unsaved_user
User.new(name: 'Jane Doe', email: 'jdoe@example.com')
end
end end