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
b303ea99
Commit
b303ea99
authored
Dec 11, 2019
by
Kerri Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract :paths into a let for shared examples
Also restores a test condition that was accidentally removed OOPS!
parent
eb1af340
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
spec/lib/gitlab/diff/highlight_cache_spec.rb
spec/lib/gitlab/diff/highlight_cache_spec.rb
+5
-1
No files found.
spec/lib/gitlab/diff/highlight_cache_spec.rb
View file @
b303ea99
...
...
@@ -82,6 +82,7 @@ describe Gitlab::Diff::HighlightCache, :clean_gitlab_redis_cache do
shared_examples
'caches missing entries'
do
it
'filters the key/value list of entries to be caches for each invocation'
do
expect
(
cache
).
to
receive
(
:write_to_redis_hash
)
.
with
(
hash_including
(
*
paths
))
.
once
.
and_call_original
...
...
@@ -96,7 +97,9 @@ describe Gitlab::Diff::HighlightCache, :clean_gitlab_redis_cache do
end
describe
'#write_if_empty'
do
it_behaves_like
'caches missing entries'
it_behaves_like
'caches missing entries'
do
let
(
:paths
)
{
merge_request
.
diffs
.
diff_files
.
select
(
&
:text?
).
map
(
&
:file_path
)
}
end
context
'different diff_collections for the same diffable'
do
before
do
...
...
@@ -122,6 +125,7 @@ describe Gitlab::Diff::HighlightCache, :clean_gitlab_redis_cache do
it_behaves_like
'caches missing entries'
do
let
(
:cache
)
{
described_class
.
new
(
merge_request_diff_batch
)
}
let
(
:paths
)
{
merge_request_diff_batch
.
diff_files
.
select
(
&
:text?
).
map
(
&
:file_path
)
}
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