summaryrefslogtreecommitdiff
path: root/spec/lib
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@gitlab.com>2019-08-06 16:42:14 +0000
committerBob Van Landuyt <bob@gitlab.com>2019-08-06 16:42:14 +0000
commitd61dab914756854c0f5bef50306be77212ee15b4 (patch)
tree7e2396450980c36fefab904e8917a15ab034a343 /spec/lib
parent550e0d45c8e2237c68d834ca00cfc866fc78bb01 (diff)
parent46631e102366bd40bdb449b87fae3f10e992ee68 (diff)
downloadgitlab-ce-d61dab914756854c0f5bef50306be77212ee15b4.tar.gz
Merge branch '65152-selective-highlight' into 'master'
Support selective highlighting of lines See merge request gitlab-org/gitlab-ce!31361
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/gitlab/highlight_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/lib/gitlab/highlight_spec.rb b/spec/lib/gitlab/highlight_spec.rb
index 4676db6b8d8..a410e4eab45 100644
--- a/spec/lib/gitlab/highlight_spec.rb
+++ b/spec/lib/gitlab/highlight_spec.rb
@@ -62,6 +62,14 @@ describe Gitlab::Highlight do
expect(lines[2].text).to eq(' """')
end
+ context 'since param is present' do
+ it 'highlights with the LC starting from "since" param' do
+ lines = described_class.highlight(file_name, content, since: 2).lines
+
+ expect(lines[0]).to include('LC2')
+ end
+ end
+
context 'diff highlighting' do
let(:file_name) { 'test.diff' }
let(:content) { "+aaa\n+bbb\n- ccc\n ddd\n"}