scenario 'HP: User Sign Up w/ Confirmable Email and Log in ' do
visit new_user_registration_path
fill_in 'Email', with: '[email protected]'
fill_in 'Password', with: 'password'
fill_in 'Password confirmation', with: 'password'
assert_difference 'User.count', 1 do
click_button 'Sign up'
mail = ActionMailer::Base.deliveries[0]
token = mail.body.decoded.match(/confirmation_token=([^"]+)/)[1]
assert_equal User.find_by(email: "[email protected]").confirmation_token, token