diff --git a/test/test_wiki.rb b/test/test_wiki.rb index f866f853..93e8622a 100644 --- a/test/test_wiki.rb +++ b/test/test_wiki.rb @@ -105,6 +105,35 @@ context "Wiki page previewing" do end end +context "Wiki TOC" do + setup do + @path = testpath("examples/lotr.git") + options = {:header_hashtags => false, :universal_toc => true} + @wiki = Gollum::Wiki.new(@path, options) + end + + test "toc_generation" do + page = @wiki.preview_page("Test", "# Bilbo", :markdown) + assert_equal "# Bilbo", page.raw_data + assert_equal '

Bilbo

', page.formatted_data.gsub(/\n/,"") + assert_equal '', page.toc_data.gsub(/\n */,"") + end +end + +context "Wiki header hashtags" do + setup do + @path = testpath("examples/lotr.git") + options = {:header_hashtags => true, :universal_toc => false} + @wiki = Gollum::Wiki.new(@path, options) + end + + test "header_hashtags" do + page = @wiki.preview_page("Test", "# Bilbo", :markdown) + assert_equal "# Bilbo", page.raw_data + assert_equal '

Bilbo

', page.formatted_data.gsub(/\n/,"") + end +end + context "Wiki page writing" do setup do @path = testpath("examples/test.git")