Merged r8871 from trunk.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.3-stable@9109 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2012-03-05 12:42:29 +00:00
parent 09ea1fd58d
commit 4930b3e8bf
2 changed files with 33 additions and 0 deletions

View File

@@ -768,6 +768,33 @@ RAW
assert textilizable(raw).gsub("\n", "").include?(expected)
end
def test_table_of_content_should_generate_unique_anchors
raw = <<-RAW
{{toc}}
h1. Title
h2. Subtitle
h2. Subtitle
RAW
expected = '<ul class="toc">' +
'<li><a href="#Title">Title</a>' +
'<ul>' +
'<li><a href="#Subtitle">Subtitle</a></li>' +
'<li><a href="#Subtitle-2">Subtitle</a></li>'
'</ul>'
'</li>' +
'</ul>'
@project = Project.find(1)
result = textilizable(raw).gsub("\n", "")
assert_include expected, result
assert_include '<a name="Subtitle">', result
assert_include '<a name="Subtitle-2">', result
end
def test_table_of_content_should_contain_included_page_headings
raw = <<-RAW
{{toc}}