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
Jérome Perrin
gitlab-ce
Commits
afd7582a
Commit
afd7582a
authored
Jun 26, 2017
by
Alexis Reigel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extract variable
parent
7fc69a7e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
spec/lib/gitlab/gpg/commit_spec.rb
spec/lib/gitlab/gpg/commit_spec.rb
+7
-6
No files found.
spec/lib/gitlab/gpg/commit_spec.rb
View file @
afd7582a
...
...
@@ -3,6 +3,7 @@ require 'rails_helper'
RSpec
.
describe
Gitlab
::
Gpg
::
Commit
do
describe
'#signature'
do
let!
(
:project
)
{
create
:project
,
:repository
,
path:
'sample-project'
}
let!
(
:commit_sha
)
{
'0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33'
}
context
'unisgned commit'
do
it
'returns nil'
do
...
...
@@ -19,7 +20,7 @@ RSpec.describe Gitlab::Gpg::Commit do
raw_commit
=
double
(
:raw_commit
,
signature:
[
GpgHelpers
::
User1
.
signed_commit_signature
,
GpgHelpers
::
User1
.
signed_commit_base_data
],
sha:
'0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33'
)
],
sha:
commit_sha
)
allow
(
raw_commit
).
to
receive
:save!
create
:commit
,
git_commit:
raw_commit
,
project:
project
...
...
@@ -27,7 +28,7 @@ RSpec.describe Gitlab::Gpg::Commit do
it
'returns a valid signature'
do
expect
(
described_class
.
new
(
commit
).
signature
).
to
have_attributes
(
commit_sha:
'0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33'
,
commit_sha:
commit_sha
,
project:
project
,
gpg_key:
gpg_key
,
gpg_key_primary_keyid:
GpgHelpers
::
User1
.
primary_keyid
,
...
...
@@ -54,7 +55,7 @@ RSpec.describe Gitlab::Gpg::Commit do
raw_commit
=
double
(
:raw_commit
,
signature:
[
GpgHelpers
::
User1
.
signed_commit_signature
,
GpgHelpers
::
User1
.
signed_commit_base_data
],
sha:
'0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33'
)
],
sha:
commit_sha
)
allow
(
raw_commit
).
to
receive
:save!
create
:commit
,
git_commit:
raw_commit
,
project:
project
...
...
@@ -62,7 +63,7 @@ RSpec.describe Gitlab::Gpg::Commit do
it
'returns an invalid signature'
do
expect
(
described_class
.
new
(
commit
).
signature
).
to
have_attributes
(
commit_sha:
'0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33'
,
commit_sha:
commit_sha
,
project:
project
,
gpg_key:
gpg_key
,
gpg_key_primary_keyid:
GpgHelpers
::
User1
.
primary_keyid
,
...
...
@@ -87,7 +88,7 @@ RSpec.describe Gitlab::Gpg::Commit do
raw_commit
=
double
(
:raw_commit
,
signature:
[
GpgHelpers
::
User1
.
signed_commit_signature
,
GpgHelpers
::
User1
.
signed_commit_base_data
],
sha:
'0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33'
)
],
sha:
commit_sha
)
allow
(
raw_commit
).
to
receive
:save!
create
:commit
,
...
...
@@ -97,7 +98,7 @@ RSpec.describe Gitlab::Gpg::Commit do
it
'returns an invalid signature'
do
expect
(
described_class
.
new
(
commit
).
signature
).
to
have_attributes
(
commit_sha:
'0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33'
,
commit_sha:
commit_sha
,
project:
project
,
gpg_key:
nil
,
gpg_key_primary_keyid:
GpgHelpers
::
User1
.
primary_keyid
,
...
...
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