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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
076a36a4
Commit
076a36a4
authored
May 17, 2021
by
Robert May
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Validate that the key contains the data
parent
46d1c976
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
1 deletion
+25
-1
spec/helpers/commits_helper_spec.rb
spec/helpers/commits_helper_spec.rb
+8
-1
spec/lib/gitlab/ci/status/core_spec.rb
spec/lib/gitlab/ci/status/core_spec.rb
+17
-0
No files found.
spec/helpers/commits_helper_spec.rb
View file @
076a36a4
...
...
@@ -291,7 +291,7 @@ RSpec.describe CommitsHelper do
end
describe
"#commit_partial_cache_key"
do
subject
{
helper
.
commit_partial_cache_key
(
commit
,
ref:
ref
,
merge_request:
merge_request
,
request:
request
)
}
subject
(
:cache_key
)
{
helper
.
commit_partial_cache_key
(
commit
,
ref:
ref
,
merge_request:
merge_request
,
request:
request
)
}
let
(
:commit
)
{
create
(
:commit
).
present
(
current_user:
user
)
}
let
(
:commit_status
)
{
Gitlab
::
Ci
::
Status
::
Running
.
new
(
pipeline
,
user
)
}
...
...
@@ -323,5 +323,12 @@ RSpec.describe CommitsHelper do
}
)
end
describe
"final cache key output"
do
subject
{
ActiveSupport
::
Cache
.
expand_cache_key
(
cache_key
)
}
it
{
is_expected
.
to
include
(
commit
.
cache_key
)
}
it
{
is_expected
.
to
include
(
pipeline
.
cache_key
)
}
end
end
end
spec/lib/gitlab/ci/status/core_spec.rb
0 → 100644
View file @
076a36a4
# frozen_string_literal: true
require
"spec_helper"
RSpec
.
describe
Gitlab
::
Ci
::
Status
::
Core
do
let
(
:subj
)
{
double
(
"subject"
,
cache_key:
"foo"
)
}
subject
(
:status
)
do
described_class
.
new
(
subj
,
double
(
"user"
))
end
describe
"#cache_key"
do
it
"uses the subject's cache key"
do
expect
(
status
.
cache_key
).
to
eq
(
subj
.
cache_key
)
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