From 4ccb8983606fbb1a5fcfd242fd15aa6275a42aaf Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Tue, 14 Feb 2012 08:09:23 +0000 Subject: Fixed: {{toc}} uses identical anchors for subsections with the same name (#8194). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8871 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/unit/helpers/application_helper_test.rb | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'test/unit') diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb index a8652b3f9..7024f6fa0 100644 --- a/test/unit/helpers/application_helper_test.rb +++ b/test/unit/helpers/application_helper_test.rb @@ -837,6 +837,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 = '' + + @project = Project.find(1) + result = textilizable(raw).gsub("\n", "") + assert_include expected, result + assert_include '', result + assert_include '', result + end + def test_table_of_content_should_contain_included_page_headings raw = <<-RAW {{toc}} -- cgit v1.2.3