summaryrefslogtreecommitdiff
path: root/spec/helpers/blob_helper_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-09-23 12:09:58 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-09-23 12:09:58 +0000
commita071c2888d62f7a56349e99f5c070407df2e17c1 (patch)
tree47e5d2cb95920a1e28348c3af5a3d9987c2805c2 /spec/helpers/blob_helper_spec.rb
parent8f2b51af416f4f4451632f6b3c2ada52c52eb44f (diff)
downloadgitlab-ce-a071c2888d62f7a56349e99f5c070407df2e17c1.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/helpers/blob_helper_spec.rb')
-rw-r--r--spec/helpers/blob_helper_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/helpers/blob_helper_spec.rb b/spec/helpers/blob_helper_spec.rb
index 98ee7c7b97c..06f86e7716a 100644
--- a/spec/helpers/blob_helper_spec.rb
+++ b/spec/helpers/blob_helper_spec.rb
@@ -5,6 +5,16 @@ require 'spec_helper'
RSpec.describe BlobHelper do
include TreeHelper
+ describe '#highlight' do
+ it 'wraps highlighted content' do
+ expect(helper.highlight('test.rb', '52')).to eq(%q[<pre class="code highlight"><code><span id="LC1" class="line" lang="ruby"><span class="mi">52</span></span></code></pre>])
+ end
+
+ it 'handles plain version' do
+ expect(helper.highlight('test.rb', '52', plain: true)).to eq(%q[<pre class="code highlight"><code><span id="LC1" class="line" lang="">52</span></code></pre>])
+ end
+ end
+
describe "#sanitize_svg_data" do
let(:input_svg_path) { File.join(Rails.root, 'spec', 'fixtures', 'unsanitized.svg') }
let(:data) { File.read(input_svg_path) }