BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
c5271833
Commit
c5271833
authored
Jul 13, 2017
by
Alexis Reigel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
show gpg key's user info when no profile exists
parent
cd01e828
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
9 deletions
+38
-9
_valid_signature_badge.html.haml
app/views/projects/commit/_valid_signature_badge.html.haml
+18
-6
commits_spec.rb
spec/features/commits_spec.rb
+20
-3
No files found.
app/views/projects/commit/_valid_signature_badge.html.haml
View file @
c5271833
...
...
@@ -6,14 +6,26 @@
-
content
=
capture
do
-
gpg_key
=
signature
.
gpg_key
-
user
=
gpg_key
&
.
user
-
user_name
=
signature
.
gpg_key_user_name
-
user_email
=
signature
.
gpg_key_user_email
=
link_to
user_path
(
gpg_key
.
user
),
class:
'gpg-popover-user-link'
do
%div
=
user_avatar_without_link
(
user:
signature
.
gpg_key
.
user
,
size:
32
)
-
if
user
=
link_to
user_path
(
user
),
class:
'gpg-popover-user-link'
do
%div
=
user_avatar_without_link
(
user:
user
,
size:
32
)
%div
%strong
=
gpg_key
.
user
.
username
%div
=
gpg_key
.
user
.
name
%div
%strong
=
gpg_key
.
user
.
username
%div
=
gpg_key
.
user
.
name
-
else
=
mail_to
user_email
do
%div
=
user_avatar_without_link
(
user_name:
user_name
,
user_email:
user_email
,
size:
32
)
%div
%strong
=
user_name
%div
=
user_email
-
locals
=
{
signature:
signature
,
title:
title
,
content:
content
,
label:
'Verified'
,
css_classes:
[
'valid'
]
}
...
...
spec/features/commits_spec.rb
View file @
c5271833
...
...
@@ -263,21 +263,25 @@ describe 'Commits' do
end
it
'shows popover badges'
,
:js
do
user
=
create
:user
,
email:
GpgHelpers
::
User1
.
emails
.
first
,
username:
'nannie.bernhard'
,
name:
'Nannie Bernhard'
project
.
team
<<
[
user
,
:master
]
gpg_user
=
create
:user
,
email:
GpgHelpers
::
User1
.
emails
.
first
,
username:
'nannie.bernhard'
,
name:
'Nannie Bernhard'
Sidekiq
::
Testing
.
inline!
do
create
:gpg_key
,
key:
GpgHelpers
::
User1
.
public_key
,
user:
user
create
:gpg_key
,
key:
GpgHelpers
::
User1
.
public_key
,
user:
gpg_
user
end
user
=
create
:user
project
.
team
<<
[
user
,
:master
]
sign_in
(
user
)
visit
namespace_project_commits_path
(
project
.
namespace
,
project
,
:'signed-commits'
)
# unverified signature
click_on
'Unverified'
,
match: :first
within
'.popover'
do
expect
(
page
).
to
have_content
'This commit was signed with an unverified signature.'
expect
(
page
).
to
have_content
"GPG Key ID:
#{
GpgHelpers
::
User2
.
primary_keyid
}
"
end
# verified and the gpg user has a gitlab profile
click_on
'Verified'
within
'.popover'
do
expect
(
page
).
to
have_content
'This commit was signed with a verified signature.'
...
...
@@ -285,6 +289,19 @@ describe 'Commits' do
expect
(
page
).
to
have_content
'Nannie Bernhard'
expect
(
page
).
to
have_content
"GPG Key ID:
#{
GpgHelpers
::
User1
.
primary_keyid
}
"
end
# verified and the gpg user's profile doesn't exist anymore
gpg_user
.
destroy!
visit
namespace_project_commits_path
(
project
.
namespace
,
project
,
:'signed-commits'
)
click_on
'Verified'
within
'.popover'
do
expect
(
page
).
to
have_content
'This commit was signed with a verified signature.'
expect
(
page
).
to
have_content
'Nannie Bernhard'
expect
(
page
).
to
have_content
'nannie.bernhard@example.com'
expect
(
page
).
to
have_content
"GPG Key ID:
#{
GpgHelpers
::
User1
.
primary_keyid
}
"
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment