Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-12-07 03:07:51 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-12-07 03:07:51 +0300
commit4e375367b78bb44bd00957522cd9fc3e6d403fef (patch)
tree059b1ce541e4128bf03683407d7b5bbbc2094ed5 /spec/features/projects/commits/user_browses_commits_spec.rb
parent99ddca0d88f1e4e49d61b1aa9d41b5785528d1dc (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features/projects/commits/user_browses_commits_spec.rb')
-rw-r--r--spec/features/projects/commits/user_browses_commits_spec.rb21
1 files changed, 17 insertions, 4 deletions
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