2019-10-12 21:52:04 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.describe Gitlab::Diff::InlineDiffMarkdownMarker do
|
2017-09-10 17:25:29 +05:30
|
|
|
describe '#mark' do
|
|
|
|
let(:raw) { "abc 'def'" }
|
2021-04-17 20:07:23 +05:30
|
|
|
let(:inline_diffs) { [Gitlab::MarkerRange.new(2, 5, mode: Gitlab::MarkerRange::DELETION)] }
|
|
|
|
let(:subject) { described_class.new(raw).mark(inline_diffs) }
|
2017-09-10 17:25:29 +05:30
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
it 'does not escape html etities and marks the range' do
|
|
|
|
expect(subject).to eq("ab{-c 'd-}ef'")
|
|
|
|
expect(subject).not_to be_html_safe
|
2017-09-10 17:25:29 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|