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'" }
|
|
|
|
let(:inline_diffs) { [2..5] }
|
|
|
|
let(:subject) { described_class.new(raw).mark(inline_diffs, mode: :deletion) }
|
|
|
|
|
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
|