Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/helpers/blob_helper_spec.rb')
-rw-r--r--spec/helpers/blob_helper_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/helpers/blob_helper_spec.rb b/spec/helpers/blob_helper_spec.rb
index b8bba36439a..74edef3a2b4 100644
--- a/spec/helpers/blob_helper_spec.rb
+++ b/spec/helpers/blob_helper_spec.rb
@@ -64,4 +64,15 @@ describe BlobHelper do
end
end
end
+
+ describe 'highlight_line' do
+ let(:expected) do
+ %q(<span id="LC1" class="line"><span class="nb">puts</span> <span class="s1">&#39;Hello&#39;</span> <span class="idiff">world</span></span>)
+ end
+
+ it 'should respect the inline diff markup' do
+ result = highlight_line('demo.rb', "puts 'Hello' <span class='idiff'>world</span>")
+ expect(result).to eq(expected)
+ end
+ end
end