let(:alert_title){'Please confirm your email address'}
let(:alert_message){"To continue, you need to select the link in the confirmation email we sent to verify your email address. If you didn't get our email, select Resend confirmation email"}
let(:alert_title){'Please confirm your email address'}
let(:alert_message){"To continue, you need to select the link in the confirmation email we sent to verify your email address. If you didn't get our email, select Resend confirmation email"}
it'asks to set 2FA before asking to accept the terms'do
expect(authentication_metrics)
.toincrement(:user_authenticated_counter)
fill_in'pin_code',with: user.reload.current_otp
fill_in'current_password',with: user.password
visitnew_user_session_path
click_button'Register with two-factor app'
click_button'Copy codes'
click_link'Proceed'
fill_in'user_login',with: user.email
fill_in'user_password',with: '12345678'
expect(current_path).toeq(profile_account_path)
expect(page).tohave_content('You have set up 2FA for your account! If you lose access to your 2FA device, you can use your recovery codes to access your account. Alternatively, if you upload an SSH key, you can use that key to generate additional recovery codes.')
expect(page).tohave_content('You have set up 2FA for your account! If you lose access to your 2FA device, you can use your recovery codes to access your account. Alternatively, if you upload an SSH key, you can use that key to generate additional recovery codes.')
context'when sending confirmation email and not yet confirmed'do
let!(:user){create(:user,confirmed_at: nil)}
let(:grace_period){2.days}
let(:alert_title){'Please confirm your email address'}
let(:alert_message){"To continue, you need to select the link in the confirmation email we sent to verify your email address. If you didn't get our email, select Resend confirmation email"}
expect(page).tohave_content('Profile was successfully updated')
expect(current_path).toeqroot_path
expect(page).tohave_content("Please check your email (#{user.email}) to verify that you own this address and unlock the power of CI/CD.")
end
end
end
context'when sending confirmation email and not yet confirmed'do
let!(:user){create(:user,confirmed_at: nil)}
let(:grace_period){2.days}
let(:alert_title){'Please confirm your email address'}
let(:alert_message){"To continue, you need to select the link in the confirmation email we sent to verify your email address. If you didn't get our email, select Resend confirmation email"}