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
679a9464
Commit
679a9464
authored
Mar 15, 2020
by
Kerri Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small refactor to DRY spec actions
parent
350f0286
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
7 deletions
+3
-7
spec/lib/gitlab/diff/highlight_cache_spec.rb
spec/lib/gitlab/diff/highlight_cache_spec.rb
+3
-7
No files found.
spec/lib/gitlab/diff/highlight_cache_spec.rb
View file @
679a9464
...
...
@@ -53,26 +53,22 @@ describe Gitlab::Diff::HighlightCache, :clean_gitlab_redis_cache do
fallback_diff_refs:
diffs
.
fallback_diff_refs
)
end
it
'does not calculate highlighting when reading from cache'
do
before
do
cache
.
write_if_empty
cache
.
decorate
(
diff_file
)
end
it
'does not calculate highlighting when reading from cache'
do
expect_any_instance_of
(
Gitlab
::
Diff
::
Highlight
).
not_to
receive
(
:highlight
)
diff_file
.
highlighted_diff_lines
end
it
'assigns highlighted diff lines to the DiffFile'
do
cache
.
write_if_empty
cache
.
decorate
(
diff_file
)
expect
(
diff_file
.
highlighted_diff_lines
.
size
).
to
be
>
5
end
it
'assigns highlighted diff lines which rich_text are HTML-safe'
do
cache
.
write_if_empty
cache
.
decorate
(
diff_file
)
rich_texts
=
diff_file
.
highlighted_diff_lines
.
map
(
&
:rich_text
)
expect
(
rich_texts
).
to
all
(
be_html_safe
)
...
...
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