Sha256: 43dc7b1289c2f087e442ef34e94cf8f5236cef5e28322ceca59fb00d9d8b3a61
Contents?: true
Size: 1.06 KB
Versions: 5
Compression:
Stored size: 1.06 KB
Contents
require 'spec_helper' describe Slacken::Filters::SanitizeList, dsl: true do describe '#valid?' do subject { described_class.new.valid?(component) } context 'when a header occurs in a list' do let(:component) do c(:ul, c(:li, text('header'), c(:indent, c(:h1, text('hoge'))))) end it { is_expected.to be_falsey } end context 'when a list occurs in another list' do let(:component) do c(:ul, c(:li, text('header'), c(:indent, c(:dl, c(:li, text('header2'), c(:indent, text('fuga'))))))) end it { is_expected.to be_truthy } end end describe '#call' do let(:filter) { described_class.new.call(component) } context 'when a list has a img tag' do let(:component) do c(:ul, c(:img)) end it 'changes img to div tag' do expect(filter.children.first.type.name).to eq :div end end end end
Version data entries
5 entries across 5 versions & 1 rubygems