spec/slide_deck_spec.rb in deckrb-0.3.0 vs spec/slide_deck_spec.rb in deckrb-0.3.1
- old
+ new
@@ -39,7 +39,21 @@
"<h1>hello</h1>\n" +
"</section>"
}
end
+ it "includes a table of contents" do
+ deck_widget :slides => Slide.split("# Foo\n\n# Bar\n")
+ toc = doc.css('.slide_toc')
+ assert { toc.size == 1 }
+ assert { noko_html(toc.first) == "<div class=\"slide_toc\">" +
+ "<div class=\"toggle\">[toc]</div>" +
+ "<ul>" +
+ "<li><a href=\"#foo\">Foo</a></li>" +
+ "<li><a href=\"#bar\">Bar</a></li>" +
+ "</ul>" +
+ "</div>"
+ }
+ end
+
end
end