diff options
author | Rubén Dávila <Ruben@GitLab.com> | 2015-12-15 18:09:09 -0500 |
---|---|---|
committer | Rubén Dávila <rdavila84@gmail.com> | 2015-12-28 18:31:27 -0500 |
commit | 34657b821ae597de76ffd5a70d2b0b298dc270ed (patch) | |
tree | b1aa6974c5631b0df71e5640329212216aeb10cf /spec/helpers/blob_helper_spec.rb | |
parent | 3a227b5abb0c794e95dd9153e3616c5d81aa06f8 (diff) | |
download | gitlab-ce-34657b821ae597de76ffd5a70d2b0b298dc270ed.tar.gz |
Add syntax highlighting to diff view. #3945
Diffstat (limited to 'spec/helpers/blob_helper_spec.rb')
-rw-r--r-- | spec/helpers/blob_helper_spec.rb | 11 |
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">'Hello'</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 |