assert_redirected_to login_path
assert_match(/^If your email address exists/, flash[:notice])
email = ActionMailer::Base.deliveries.first
assert_redirected_to login_path
assert_match(/^If your email address exists/, flash[:notice])
email = ActionMailer::Base.deliveries.first
assert_redirected_to login_path
assert_match(/^If your email address exists/, flash[:notice])
assert_redirected_to login_path
assert_match(/^If your email address exists/, flash[:notice])
assert_redirected_to login_path
assert_match(/^If your email address exists/, flash[:notice])
email = ActionMailer::Base.deliveries.first
assert_redirected_to login_path
assert_match(/^If your email address exists/, flash[:notice])
email = ActionMailer::Base.deliveries.first
assert_redirected_to login_path
assert_match(/^If your email address exists/, flash[:notice])
assert_redirected_to login_path
assert_match(/^If your email address exists/, flash[:notice])
assert_redirected_to login_path
assert_match(/^If your email address exists/, flash[:notice])
email = ActionMailer::Base.deliveries.first
assert_redirected_to login_path
assert_match(/^If your email address exists/, flash[:notice])
email = ActionMailer::Base.deliveries.first
assert_redirected_to login_path
assert_match(/^If your email address exists/, flash[:notice])
email = ActionMailer::Base.deliveries.first
assert_equal 1, email.to.count
assert_equal third_user.email, email.to.first
assert_redirected_to login_path
assert_match(/^If your email address exists/, flash[:notice])
email = ActionMailer::Base.deliveries.first
assert_equal 1, email.to.count
assert_equal third_user.email, email.to.first
# Test a request with a bogus token
get user_reset_password_path, :params => { :token => "made_up_token" }
# Test a request with a bogus token
get user_reset_password_path, :params => { :token => "made_up_token" }
# Test setting a new password
post user_reset_password_path, :params => { :token => token, :user => { :pass_crypt => "new_password", :pass_crypt_confirmation => "new_password" } }
# Test setting a new password
post user_reset_password_path, :params => { :token => token, :user => { :pass_crypt => "new_password", :pass_crypt_confirmation => "new_password" } }
assert_redirected_to root_path
assert_equal user.id, session[:user]
user.reload
assert_redirected_to root_path
assert_equal user.id, session[:user]
user.reload