Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
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
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
9 deletions
+38
-9
app/views/projects/commit/_valid_signature_badge.html.haml
app/views/projects/commit/_valid_signature_badge.html.haml
+18
-6
spec/features/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 @@
...
@@ -6,14 +6,26 @@
-
content
=
capture
do
-
content
=
capture
do
-
gpg_key
=
signature
.
gpg_key
-
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
-
if
user
%div
=
link_to
user_path
(
user
),
class:
'gpg-popover-user-link'
do
=
user_avatar_without_link
(
user:
signature
.
gpg_key
.
user
,
size:
32
)
%div
=
user_avatar_without_link
(
user:
user
,
size:
32
)
%div
%div
%strong
=
gpg_key
.
user
.
username
%strong
=
gpg_key
.
user
.
username
%div
=
gpg_key
.
user
.
name
%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'
]
}
-
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
...
@@ -263,21 +263,25 @@ describe 'Commits' do
end
end
it
'shows popover badges'
,
:js
do
it
'shows popover badges'
,
:js
do
user
=
create
:user
,
email:
GpgHelpers
::
User1
.
emails
.
first
,
username:
'nannie.bernhard'
,
name:
'Nannie Bernhard'
gpg_user
=
create
:user
,
email:
GpgHelpers
::
User1
.
emails
.
first
,
username:
'nannie.bernhard'
,
name:
'Nannie Bernhard'
project
.
team
<<
[
user
,
:master
]
Sidekiq
::
Testing
.
inline!
do
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
end
user
=
create
:user
project
.
team
<<
[
user
,
:master
]
sign_in
(
user
)
sign_in
(
user
)
visit
namespace_project_commits_path
(
project
.
namespace
,
project
,
:'signed-commits'
)
visit
namespace_project_commits_path
(
project
.
namespace
,
project
,
:'signed-commits'
)
# unverified signature
click_on
'Unverified'
,
match: :first
click_on
'Unverified'
,
match: :first
within
'.popover'
do
within
'.popover'
do
expect
(
page
).
to
have_content
'This commit was signed with an unverified signature.'
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
}
"
expect
(
page
).
to
have_content
"GPG Key ID:
#{
GpgHelpers
::
User2
.
primary_keyid
}
"
end
end
# verified and the gpg user has a gitlab profile
click_on
'Verified'
click_on
'Verified'
within
'.popover'
do
within
'.popover'
do
expect
(
page
).
to
have_content
'This commit was signed with a verified signature.'
expect
(
page
).
to
have_content
'This commit was signed with a verified signature.'
...
@@ -285,6 +289,19 @@ describe 'Commits' do
...
@@ -285,6 +289,19 @@ describe 'Commits' do
expect
(
page
).
to
have_content
'Nannie Bernhard'
expect
(
page
).
to
have_content
'Nannie Bernhard'
expect
(
page
).
to
have_content
"GPG Key ID:
#{
GpgHelpers
::
User1
.
primary_keyid
}
"
expect
(
page
).
to
have_content
"GPG Key ID:
#{
GpgHelpers
::
User1
.
primary_keyid
}
"
end
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
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