code=%Q{-<span id="LC9" class="line" lang="ruby"> <span class="k">raise</span> <span class="s2">"System commands must be given as an array of strings"</span></span>\n}
code=%Q{-<span id="LC9" class="line" lang="ruby"> <span class="k">raise</span> <span class="s2">"System commands must be given as an array of strings"</span></span>\n}
expect(subject[4].text).toeq(code)
expect(subject[4].rich_text).toeq(code)
end
end
it'highlights and marks added lines'do
it'highlights and marks added lines'do
code=%Q{+<span id="LC9" class="line" lang="ruby"> <span class="k">raise</span> <span class="no"><span class="idiff left">RuntimeError</span></span><span class="p"><span class="idiff">,</span></span><span class="idiff right"> </span><span class="s2">"System commands must be given as an array of strings"</span></span>\n}
code=%Q{+<span id="LC9" class="line" lang="ruby"> <span class="k">raise</span> <span class="no"><span class="idiff left">RuntimeError</span></span><span class="p"><span class="idiff">,</span></span><span class="idiff right"> </span><span class="s2">"System commands must be given as an array of strings"</span></span>\n}
expect(subject[5].text).toeq(code)
expect(subject[5].rich_text).toeq(code)
end
end
end
end
...
@@ -69,8 +69,8 @@ describe Gitlab::Diff::Highlight do
...
@@ -69,8 +69,8 @@ describe Gitlab::Diff::Highlight do
it'marks added lines'do
it'marks added lines'do
code=%q{+ raise <span class="idiff left right">RuntimeError, </span>"System commands must be given as an array of strings"}
code=%q{+ raise <span class="idiff left right">RuntimeError, </span>"System commands must be given as an array of strings"}
expect(subject[5].text).toeq(code)
expect(subject[5].rich_text).toeq(code)
expect(subject[5].text).tobe_html_safe
expect(subject[5].rich_text).tobe_html_safe
end
end
context'when the inline diff marker has an invalid range'do
context'when the inline diff marker has an invalid range'do