debian-mirror-gitlab/spec/features/users/add_email_to_existing_account_spec.rb

30 lines
914 B
Ruby
Raw Normal View History

2019-10-12 21:52:04 +05:30
# frozen_string_literal: true
2018-11-18 11:00:15 +05:30
require 'spec_helper'
2020-06-23 00:09:42 +05:30
RSpec.describe 'AdditionalEmailToExistingAccount' do
2018-11-18 11:00:15 +05:30
describe 'add secondary email associated with account' do
2021-06-08 01:23:25 +05:30
let_it_be(:user) { create(:user) }
let_it_be(:email) { create(:email, user: user) }
2018-11-18 11:00:15 +05:30
2021-06-08 01:23:25 +05:30
before do
2018-11-18 11:00:15 +05:30
sign_in(user)
2021-06-08 01:23:25 +05:30
end
it 'verifies confirmation of additional email' do
visit email_confirmation_path(confirmation_token: email.confirmation_token)
expect(page).to have_content 'Your email address has been successfully confirmed.'
end
it 'accepts any pending invites for an email confirmation' do
member = create(:group_member, :invited, invite_email: email.email)
2018-11-18 11:00:15 +05:30
visit email_confirmation_path(confirmation_token: email.confirmation_token)
2021-06-08 01:23:25 +05:30
expect(member.reload.user).to eq(user)
2018-11-18 11:00:15 +05:30
expect(page).to have_content 'Your email address has been successfully confirmed.'
end
end
end