# Preview all emails at http://localhost:4000/rails/mailers/user_mailer
class UserMailerPreview < ActionMailer::Preview

  def setup
    # deliveriesは配列なので、setupで初期化しておかないと他のテストで実行されたメールが残る。
    ActionMailer::Base.deliveries.clear
  end
  # Preview this email at http://localhost:4000/rails/mailers/user_mailer/account_activation
  def account_activation
    user = User.first
    user.activation_token = User.new_token
    UserMailer.account_activation(user)
  end

  # Preview this email at
  # http://localhost:4000/rails/mailers/user_mailer/password_reset
  def password_reset
    user = User.first
    user.reset_token = User.new_token
    UserMailer.password_reset(user)
  end
       
end