email = ActionMailer::Base.deliveries.last
assert_equal user.email, email.to.first
-
- ActionMailer::Base.deliveries.clear
end
def test_confirm_resend_deleted
confirm_string = user.generate_token_for(:new_email)
post user_confirm_email_path, :params => { :confirm_string => confirm_string }
- assert_redirected_to edit_account_path
+ assert_redirected_to account_path
assert_match(/Confirmed your change of email address/, flash[:notice])
end
confirm_string = user.generate_token_for(:new_email)
post user_confirm_email_path, :params => { :confirm_string => confirm_string }
- assert_redirected_to edit_account_path
+ assert_redirected_to account_path
assert_match(/already been confirmed/, flash[:error])
end
def test_confirm_email_bad_token
post user_confirm_email_path, :params => { :confirm_string => "XXXXX" }
- assert_redirected_to edit_account_path
+ assert_redirected_to account_path
assert_match(/confirmation code has expired or does not exist/, flash[:error])
end
# precondition gravatar should be turned off
assert_not user.image_use_gravatar
post user_confirm_email_path, :params => { :confirm_string => confirm_string }
- assert_redirected_to edit_account_path
+ assert_redirected_to account_path
assert_match(/Confirmed your change of email address/, flash[:notice])
# gravatar use should now be enabled
assert User.find(user.id).image_use_gravatar
# precondition gravatar should be turned on
assert user.image_use_gravatar
post user_confirm_email_path, :params => { :confirm_string => confirm_string }
- assert_redirected_to edit_account_path
+ assert_redirected_to account_path
assert_match(/Confirmed your change of email address/, flash[:notice])
# gravatar use should now be disabled
assert_not User.find(user.id).image_use_gravatar