summaryrefslogtreecommitdiff
path: root/spec/lib/banzai/suggestions_parser_spec.rb
blob: 79658d710ce2f9afb82328412f4ebfa324d37cc1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# frozen_string_literal: true

require 'spec_helper'

describe Banzai::SuggestionsParser do
  describe '.parse' do
    it 'returns a list of suggestion contents' do
      markdown = <<-MARKDOWN.strip_heredoc
        ```suggestion
          foo
          bar
        ```

        ```
          nothing
        ```

        ```suggestion
          xpto
          baz
        ```

        ```thing
          this is not a suggestion, it's a thing
        ```
      MARKDOWN

      expect(described_class.parse(markdown)).to eq(["  foo\n  bar",
                                                     "  xpto\n  baz"])
    end
  end
end