blob: e5d63014a4f5c39a4546f02afa453d2e2d208427 (
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
|
require 'spec_helper'
require 'filters/tabs'
describe TabsFilter do
describe '#run' do
let(:content) { nil }
subject(:run) { described_class.new.run(content) }
context 'when Tab title' do
let(:content) { '<p>:::TabTitle Cats</p>' }
it 'returns correct HTML' do
expect(run).to eq('<div class="tab-title">Cats</div>')
end
end
context 'when Tab wrapper' do
let(:content) { '<p>::Tabs</p>Tabs content<p>::EndTabs</p>' }
it 'returns correct HTML' do
expect(run).to eq("<div class=\"js-tabs\">Tabs content</div>")
end
end
end
end
|