mirror of
https://github.com/redmine/redmine.git
synced 2026-05-07 11:36:38 +02:00
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:
@@ -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}}
|
||||
|
||||
Reference in New Issue
Block a user