diff options
author | Robert Speicher <rspeicher@gmail.com> | 2016-03-23 03:27:36 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2016-05-25 23:56:06 +0300 |
commit | 2682c5884777f1bfd5cb0b5c85b1f3c188906460 (patch) | |
tree | dd4ff8e8ae0e4b9f11fcf253acda7f44670a3d7a | |
parent | f96127bc2c9d9b711960cc2ea4cb4f2ffde5cfcb (diff) |
Customize ActionMailer preview path
-rw-r--r-- | config/environments/development.rb | 1 | ||||
-rw-r--r-- | spec/mailers/previews/devise_mailer_preview.rb | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/config/environments/development.rb b/config/environments/development.rb index 4f39016bfa4..8cca0039b4a 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -39,6 +39,7 @@ Rails.application.configure do config.action_mailer.delivery_method = :letter_opener_web # Don't make a mess when bootstrapping a development environment config.action_mailer.perform_deliveries = (ENV['BOOTSTRAP'] != '1') + config.action_mailer.preview_path = 'spec/mailers/previews' config.eager_load = false end diff --git a/spec/mailers/previews/devise_mailer_preview.rb b/spec/mailers/previews/devise_mailer_preview.rb new file mode 100644 index 00000000000..8a4d6e7250e --- /dev/null +++ b/spec/mailers/previews/devise_mailer_preview.rb @@ -0,0 +1,11 @@ +class DeviseMailerPreview < ActionMailer::Preview + def confirmation_instructions_for_signup + user = User.new(email: 'signup@example.com') + DeviseMailer.confirmation_instructions(user, 'faketoken', {}) + end + + def confirmation_instructions_for_new_email + user = User.last + DeviseMailer.confirmation_instructions(user, 'faketoken', {}) + end +end |