diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-16 15:09:27 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-16 15:09:27 +0000 |
commit | 8d4aaa4dd07cd02383f7d09d74eb66ffe47a41c4 (patch) | |
tree | 684210b8b7c8b5664e8d7b529e59ffde6bcfaed4 /spec | |
parent | cbfe03ae04a52d9825ff7cbeccdfe5d313adf6a2 (diff) | |
download | gitlab-ce-8d4aaa4dd07cd02383f7d09d74eb66ffe47a41c4.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/gitlab/diff/highlight_cache_spec.rb | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/spec/lib/gitlab/diff/highlight_cache_spec.rb b/spec/lib/gitlab/diff/highlight_cache_spec.rb index eb8072a554e..457e81bc95f 100644 --- a/spec/lib/gitlab/diff/highlight_cache_spec.rb +++ b/spec/lib/gitlab/diff/highlight_cache_spec.rb @@ -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) |