2019-07-25 01:21:37 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-08-29 03:56:52 -04:00
|
|
|
require 'spec_helper'
|
2017-09-12 11:14:54 -04:00
|
|
|
|
2020-06-24 05:08:32 -04:00
|
|
|
RSpec.describe Banzai::Pipeline::EmailPipeline do
|
2017-09-12 11:14:54 -04:00
|
|
|
describe '.filters' do
|
|
|
|
it 'returns the expected type' do
|
|
|
|
expect(described_class.filters).to be_kind_of(Banzai::FilterArray)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'excludes ImageLazyLoadFilter' do
|
|
|
|
expect(described_class.filters).not_to be_empty
|
|
|
|
expect(described_class.filters).not_to include(Banzai::Filter::ImageLazyLoadFilter)
|
|
|
|
end
|
2019-01-14 17:57:54 -05:00
|
|
|
|
|
|
|
it 'shows punycode for autolinks' do
|
|
|
|
examples = %W[
|
|
|
|
http://one😄two.com
|
|
|
|
http://\u0261itlab.com
|
|
|
|
]
|
|
|
|
|
|
|
|
examples.each do |markdown|
|
|
|
|
result = described_class.call(markdown, project: nil)[:output]
|
|
|
|
link = result.css('a').first
|
|
|
|
|
|
|
|
expect(link.content).to include('http://xn--')
|
|
|
|
end
|
|
|
|
end
|
2017-09-12 11:14:54 -04:00
|
|
|
end
|
|
|
|
end
|