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
c8e4f59a
Commit
c8e4f59a
authored
Nov 27, 2019
by
Kerri Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unrequired backend parameter
parent
93676c82
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
11 deletions
+2
-11
lib/gitlab/diff/highlight_cache.rb
lib/gitlab/diff/highlight_cache.rb
+1
-2
spec/lib/gitlab/diff/highlight_cache_spec.rb
spec/lib/gitlab/diff/highlight_cache_spec.rb
+1
-9
No files found.
lib/gitlab/diff/highlight_cache.rb
View file @
c8e4f59a
...
...
@@ -9,8 +9,7 @@ module Gitlab
delegate
:diffable
,
to: :@diff_collection
delegate
:diff_options
,
to: :@diff_collection
def
initialize
(
diff_collection
,
backend:
Rails
.
cache
)
@backend
=
backend
def
initialize
(
diff_collection
)
@diff_collection
=
diff_collection
end
...
...
spec/lib/gitlab/diff/highlight_cache_spec.rb
View file @
c8e4f59a
...
...
@@ -39,11 +39,9 @@ describe Gitlab::Diff::HighlightCache, :clean_gitlab_redis_cache do
let
(
:cache_key
)
{
cache
.
key
}
subject
(
:cache
)
{
described_class
.
new
(
merge_request
.
diffs
,
backend:
backend
)
}
subject
(
:cache
)
{
described_class
.
new
(
merge_request
.
diffs
)
}
describe
'#decorate'
do
let
(
:backend
)
{
double
(
'backend'
).
as_null_object
}
# Manually creates a Diff::File object to avoid triggering the cache on
# the FileCollection::MergeRequestDiff
let
(
:diff_file
)
do
...
...
@@ -73,8 +71,6 @@ describe Gitlab::Diff::HighlightCache, :clean_gitlab_redis_cache do
end
describe
'#write_if_empty'
do
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
)
.
once
.
with
(
hash_including
(
".gitignore"
)).
and_call_original
...
...
@@ -98,8 +94,6 @@ describe Gitlab::Diff::HighlightCache, :clean_gitlab_redis_cache do
end
describe
'#write_to_redis_hash'
do
let
(
:backend
)
{
Rails
.
cache
}
it
'creates or updates a Redis hash'
do
expect
{
cache
.
send
(
:write_to_redis_hash
,
diff_hash
)
}
.
to
change
{
Gitlab
::
Redis
::
Cache
.
with
{
|
r
|
r
.
hgetall
(
cache_key
)
}
}
...
...
@@ -107,8 +101,6 @@ describe Gitlab::Diff::HighlightCache, :clean_gitlab_redis_cache do
end
describe
'#clear'
do
let
(
:backend
)
{
double
(
'backend'
).
as_null_object
}
it
'clears cache'
do
expect_any_instance_of
(
Redis
).
to
receive
(
:del
).
with
(
cache_key
)
...
...
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