require_relative '../../spec_helper'
describe Tabulous::DefaultRenderer do
include Tabulous::TestData
before(:each) do
create_sample_tabset
@renderer = Tabulous::DefaultRenderer.new(@tabset, @view)
end
it "should return HTML for tabs" do
tabs_html = @renderer.tabs_html
tabs_html.should be_a(String)
expect(tabs_html).to match(/
/)
expect(tabs_html).to_not match(/
/)
end
it "should return HTML for subtabs" do
subtabs_html = @renderer.subtabs_html
subtabs_html.should be_a(String)
expect(subtabs_html).to match(/
/)
expect(subtabs_html).to_not match(/
/)
end
it "should not show invisible tabs" do
expect(@renderer.tabs_html).to_not match(/cookies/)
end
it "should have the correct HTML for disabled tabs" do
expect(@renderer.tabs_html).to match(/
cupcakes<\/span><\/li>/)
end
it "should return the expected HTML for tabs" do
tabs_html = @renderer.tabs_html
expected_html = <<-HTML.strip_heredoc
HTML
tabs_html.should == expected_html
end
it "should return the expected HTML for subtabs" do
subtabs_html = @renderer.subtabs_html
expected_html = <<-HTML.strip_heredoc
HTML
subtabs_html.should == expected_html
end
end