2018-03-17 18:26:18 +05:30
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
describe Banzai::Pipeline::EmailPipeline do
|
|
|
|
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-02-13 22:33:31 +05:30
|
|
|
|
|
|
|
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
|
2018-03-17 18:26:18 +05:30
|
|
|
end
|
|
|
|
end
|