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
93676c82
Commit
93676c82
authored
Nov 26, 2019
by
Kerri Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test uncached files are added during #write_if_empty
parent
4cd99b39
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
spec/lib/gitlab/diff/highlight_cache_spec.rb
spec/lib/gitlab/diff/highlight_cache_spec.rb
+14
-1
No files found.
spec/lib/gitlab/diff/highlight_cache_spec.rb
View file @
93676c82
...
...
@@ -73,7 +73,7 @@ describe Gitlab::Diff::HighlightCache, :clean_gitlab_redis_cache do
end
describe
'#write_if_empty'
do
let
(
:backend
)
{
double
(
'backend'
,
read:
{}).
as_null_object
}
let
(
:backend
)
{
Rails
.
cache
}
it
'filters the key/value list of entries to be caches for each invocation'
do
expect
(
cache
).
to
receive
(
:write_to_redis_hash
)
...
...
@@ -82,6 +82,19 @@ describe Gitlab::Diff::HighlightCache, :clean_gitlab_redis_cache do
2
.
times
{
cache
.
write_if_empty
}
end
context
'different diff_collections for the same diffable'
do
before
do
cache
.
write_if_empty
end
it
'writes an uncached files in the collection to the same redis hash'
do
Gitlab
::
Redis
::
Cache
.
with
{
|
r
|
r
.
hdel
(
cache_key
,
"files/whitespace"
)
}
expect
{
cache
.
write_if_empty
}
.
to
change
{
Gitlab
::
Redis
::
Cache
.
with
{
|
r
|
r
.
hgetall
(
cache_key
)
}
}
end
end
end
describe
'#write_to_redis_hash'
do
...
...
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