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
f2b22869
Commit
f2b22869
authored
Dec 09, 2019
by
Kerri Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add additional tests for #file_path
parent
867ec62f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
4 deletions
+37
-4
spec/lib/gitlab/diff/highlight_cache_spec.rb
spec/lib/gitlab/diff/highlight_cache_spec.rb
+37
-4
No files found.
spec/lib/gitlab/diff/highlight_cache_spec.rb
View file @
f2b22869
...
...
@@ -112,11 +112,44 @@ describe Gitlab::Diff::HighlightCache, :clean_gitlab_redis_cache do
end
describe
`#file_paths`
do
it
'accesses path info via #diff_files'
do
expect_any_instance_of
(
Gitlab
::
Diff
::
FileCollection
::
MergeRequestDiff
)
.
to
receive
(
:diff_files
).
at_least
(
:once
).
and_call_original
it
'accesses path info without error'
do
expect
{
cache
.
send
(
:file_paths
)
}
.
not_to
raise_error
end
it
'returns an array of file path strings'
do
results
=
cache
.
send
(
:file_paths
)
expect
(
results
).
to
be_an
Array
expect
(
results
).
not_to
be_empty
expect
(
results
).
to
include
(
".DS_Store"
)
end
context
'when cache initialized with MergeRequestDiffBatch'
do
let
(
:merge_request_diff_batch
)
do
Gitlab
::
Diff
::
FileCollection
::
MergeRequestDiffBatch
.
new
(
merge_request
.
merge_request_diff
,
1
,
10
,
diff_options:
nil
)
end
cache
.
send
(
:file_paths
)
subject
(
:cache_with_merge_request_diff_batch
)
do
described_class
.
new
(
merge_request_diff_batch
)
end
it
'accesses path info without error'
do
expect
{
cache_with_merge_request_diff_batch
.
send
(
:file_paths
)
}
.
not_to
raise_error
end
it
'returns an array of file path strings'
do
results
=
cache_with_merge_request_diff_batch
.
send
(
:file_paths
)
expect
(
results
).
to
be_an
Array
expect
(
results
).
not_to
be_empty
expect
(
results
).
to
include
(
".DS_Store"
)
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