added user maintenance functional test

This commit is contained in:
albert
2011-02-01 18:33:17 -05:00
parent 8eb3451fb4
commit 494abe30bb
7 changed files with 101 additions and 6 deletions

View File

@@ -1,10 +1,25 @@
class UserMaintenanceController < ApplicationController
def delete_account
end
def login_reminder
if request.post?
@user = User.with_email(params[:user][:email]).first
if @user
UserMaintenanceMailer.login_reminder(@user).deliver
flash[:notice] = "Email sent"
else
flash[:notice] = "No matching user record found"
end
end
end
def reset_password
if request.post?
@user = User.find_for_password_reset(params[:user][:name], params[:user][:email]).first
if @user
@user.reset_password_and_deliver_notice
flash[:notice] = "Email sent"
else
flash[:notice] = "No matching user record found"
end
end
end
end