diff options
author | Douwe Maan <douwe@selenight.nl> | 2018-11-14 21:09:33 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-11-14 22:03:20 +0300 |
commit | 78c8a3e37d27383ef6d452ef4c6124d49cd99aa7 (patch) | |
tree | a7b7ad68730234d6415e853b08374f60084f98e2 /spec/helpers/profiles_helper_spec.rb | |
parent | 5b1b093403f8a3108a5de6572fd503cef763ae81 (diff) |
Fix bug causing not all emails to show up in commit email selectbox
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/54045
Diffstat (limited to 'spec/helpers/profiles_helper_spec.rb')
-rw-r--r-- | spec/helpers/profiles_helper_spec.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/spec/helpers/profiles_helper_spec.rb b/spec/helpers/profiles_helper_spec.rb index 9a2372de69f..8e336469c27 100644 --- a/spec/helpers/profiles_helper_spec.rb +++ b/spec/helpers/profiles_helper_spec.rb @@ -4,12 +4,17 @@ describe ProfilesHelper do describe '#commit_email_select_options' do it 'returns an array with private commit email along with all the verified emails' do user = create(:user) + create(:email, user: user) + confirmed_email1 = create(:email, :confirmed, user: user) + confirmed_email2 = create(:email, :confirmed, user: user) + private_email = user.private_commit_email - verified_emails = user.verified_emails - [private_email] emails = [ ["Use a private email - #{private_email}", Gitlab::PrivateCommitEmail::TOKEN], - verified_emails + user.email, + confirmed_email1.email, + confirmed_email2.email ] expect(helper.commit_email_select_options(user)).to match_array(emails) |