diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-07 00:07:51 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-07 00:07:51 +0000 |
commit | 4e375367b78bb44bd00957522cd9fc3e6d403fef (patch) | |
tree | 059b1ce541e4128bf03683407d7b5bbbc2094ed5 /spec/features | |
parent | 99ddca0d88f1e4e49d61b1aa9d41b5785528d1dc (diff) | |
download | gitlab-ce-4e375367b78bb44bd00957522cd9fc3e6d403fef.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/participants_autocomplete_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/projects/commits/user_browses_commits_spec.rb | 21 |
2 files changed, 18 insertions, 5 deletions
diff --git a/spec/features/participants_autocomplete_spec.rb b/spec/features/participants_autocomplete_spec.rb index 312285ca2cb..a7bba124716 100644 --- a/spec/features/participants_autocomplete_spec.rb +++ b/spec/features/participants_autocomplete_spec.rb @@ -61,7 +61,7 @@ describe 'Member autocomplete', :js do before do allow(User).to receive(:find_by_any_email) - .with(noteable.author_email.downcase).and_return(author) + .with(noteable.author_email.downcase, confirmed: true).and_return(author) visit project_commit_path(project, noteable) end diff --git a/spec/features/projects/commits/user_browses_commits_spec.rb b/spec/features/projects/commits/user_browses_commits_spec.rb index b22715a44f0..7e59e36ccb7 100644 --- a/spec/features/projects/commits/user_browses_commits_spec.rb +++ b/spec/features/projects/commits/user_browses_commits_spec.rb @@ -76,16 +76,23 @@ describe 'User browses commits' do end context 'secondary email' do + let(:user) { create(:user) } + it 'finds a commit by a secondary email' do - user = - create(:user) do |user| - create(:email, { user: user, email: 'dmitriy.zaporozhets@gmail.com' }) - end + create(:email, :confirmed, user: user, email: 'dmitriy.zaporozhets@gmail.com') visit(project_commit_path(project, sample_commit.parent_id)) check_author_link(sample_commit.author_email, user) end + + it 'links to an unverified e-mail address instead of the user' do + create(:email, user: user, email: 'dmitriy.zaporozhets@gmail.com') + + visit(project_commit_path(project, sample_commit.parent_id)) + + check_author_email(sample_commit.author_email) + end end context 'when the blob does not exist' do @@ -263,3 +270,9 @@ def check_author_link(email, author) expect(author_link['href']).to eq(user_path(author)) expect(find('.commit-author-name').text).to eq(author.name) end + +def check_author_email(email) + author_link = find('.commit-author-link') + + expect(author_link['href']).to eq("mailto:#{email}") +end |