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
Boxiang Sun
gitlab-ce
Commits
9d30a80d
Commit
9d30a80d
authored
Jun 22, 2017
by
Alexis Reigel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update features specs for gpg commits
parent
a01eabc1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
13 deletions
+38
-13
spec/features/commits_spec.rb
spec/features/commits_spec.rb
+38
-13
No files found.
spec/features/commits_spec.rb
View file @
9d30a80d
...
...
@@ -206,36 +206,51 @@ describe 'Commits' do
end
describe
'GPG signed commits'
do
let!
(
:user
)
{
create
:user
,
email:
GpgHelpers
::
User1
.
emails
.
first
}
let!
(
:gpg_key
)
{
create
:gpg_key
,
key:
GpgHelpers
::
User1
.
public_key
,
user:
user
}
before
do
project
.
team
<<
[
user
,
:master
]
login_with
(
user
)
end
it
'shows the signed status'
,
:gpg
do
# FIXME: add this to the test repository directly
remote_path
=
project
.
repository
.
path_to_repo
Dir
.
mktmpdir
do
|
dir
|
FileUtils
.
cd
dir
do
`git clone --quiet
#{
remote_path
}
.`
`git commit --quiet -S
#{
GpgHelpers
::
User1
.
primary_keyid
}
--allow-empty -m "signed commit
, verified key/email
"`
`git commit --quiet -S
#{
GpgHelpers
::
User2
.
primary_keyid
}
--allow-empty -m "signed commit
, unverified key/email
"`
`git commit --quiet -S
#{
GpgHelpers
::
User1
.
primary_keyid
}
--allow-empty -m "signed commit
by nannie bernhard
"`
`git commit --quiet -S
#{
GpgHelpers
::
User2
.
primary_keyid
}
--allow-empty -m "signed commit
by bette cartwright
"`
`git push --quiet`
end
end
end
it
'changes from unverified to verified when the user changes his email to match the gpg key'
do
user
=
create
:user
,
email:
'unrelated.user@example.org'
project
.
team
<<
[
user
,
:master
]
create
:gpg_key
,
key:
GpgHelpers
::
User1
.
public_key
,
user:
user
login_with
(
user
)
visit
namespace_project_commits_path
(
project
.
namespace
,
project
,
:master
)
within
'#commits-list'
do
expect
(
page
).
to
have_content
'Unverified'
expect
(
page
).
to
have_content
'Verified'
expect
(
page
).
not_
to
have_content
'Verified'
end
# user changes his email which makes the gpg key
un
verified
# user changes his email which makes the gpg key verified
user
.
skip_reconfirmation!
user
.
update_attributes!
(
email:
'bette.cartwright@example.org'
)
user
.
update_attributes!
(
email:
GpgHelpers
::
User1
.
emails
.
first
)
visit
namespace_project_commits_path
(
project
.
namespace
,
project
,
:master
)
within
'#commits-list'
do
expect
(
page
).
to
have_content
'Unverified'
expect
(
page
).
to
have_content
'Verified'
end
end
it
'changes from unverified to verified when the user adds the missing gpg key'
do
user
=
create
:user
,
email:
GpgHelpers
::
User1
.
emails
.
first
project
.
team
<<
[
user
,
:master
]
login_with
(
user
)
visit
namespace_project_commits_path
(
project
.
namespace
,
project
,
:master
)
...
...
@@ -243,6 +258,16 @@ describe 'Commits' do
expect
(
page
).
to
have_content
'Unverified'
expect
(
page
).
not_to
have_content
'Verified'
end
# user adds the gpg key which makes the signature valid
create
:gpg_key
,
key:
GpgHelpers
::
User1
.
public_key
,
user:
user
visit
namespace_project_commits_path
(
project
.
namespace
,
project
,
:master
)
within
'#commits-list'
do
expect
(
page
).
to
have_content
'Unverified'
expect
(
page
).
to
have_content
'Verified'
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