blob: e267674e3b0706367e4e5d26939331c8b0813b70 (
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
|
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Banzai::Filter::NormalizeSourceFilter, feature_category: :team_planning do
include FilterSpecHelper
it 'removes the UTF8 BOM from the beginning of the text' do
content = "\xEF\xBB\xBF---"
output = filter(content)
expect(output).to match '---'
end
it 'does not remove those characters from anywhere else in the text' do
content = <<~MD
\xEF\xBB\xBF---
\xEF\xBB\xBF---
MD
output = filter(content)
expect(output).to match "---\n\xEF\xBB\xBF---\n"
end
end
|