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

inline_diff_markdown_marker_spec.rb « diff « gitlab « lib « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 87d47e36f6a4b506817aec32d6ad3fa6d9acd1c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# frozen_string_literal: true

require 'fast_spec_helper'

RSpec.describe Gitlab::Diff::InlineDiffMarkdownMarker do
  describe '#mark' do
    let(:raw) { "abc 'def'" }
    let(:inline_diffs) { [Gitlab::MarkerRange.new(2, 5, mode: Gitlab::MarkerRange::DELETION)] }
    let(:subject) { described_class.new(raw).mark(inline_diffs) }

    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
    end
  end
end