summaryrefslogtreecommitdiffstats
path: root/test/unit/helpers
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2010-11-06 17:47:27 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2010-11-06 17:47:27 +0000
commit024ff96ee27aa7e61ceec25a351f6800461d5cf3 (patch)
treed0cc3a32d0990d422916caa5ff4793beb5a990e5 /test/unit/helpers
parent666c54e86c2a8532ff9330d7ce4e9e7d3a44b173 (diff)
downloadredmine-024ff96ee27aa7e61ceec25a351f6800461d5cf3.tar.gz
redmine-024ff96ee27aa7e61ceec25a351f6800461d5cf3.zip
Extract headings and TOC parsing from the textile formatter.
Fixes #2038 and #3707 and will allow to support TOC with other text formatters. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4376 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/helpers')
-rw-r--r--test/unit/helpers/application_helper_test.rb24
1 files changed, 23 insertions, 1 deletions
diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb
index 52bb13298..be4c79582 100644
--- a/test/unit/helpers/application_helper_test.rb
+++ b/test/unit/helpers/application_helper_test.rb
@@ -1,5 +1,5 @@
# Redmine - project management software
-# Copyright (C) 2006-2009 Jean-Philippe Lang
+# Copyright (C) 2006-2010 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -422,6 +422,8 @@ Nullam commodo metus accumsan nulla. Curabitur lobortis dui id dolor.
h2. Subtitle with [[Wiki|another Wiki]] link
h2. Subtitle with %{color:red}red text%
+
+h2. Subtitle with *some* _modifiers_
h1. Another title
@@ -436,11 +438,31 @@ RAW
'<li class="heading2"><a href="#Subtitle-with-a-Wiki-link">Subtitle with a Wiki link</a></li>' +
'<li class="heading2"><a href="#Subtitle-with-another-Wiki-link">Subtitle with another Wiki link</a></li>' +
'<li class="heading2"><a href="#Subtitle-with-red-text">Subtitle with red text</a></li>' +
+ '<li class="heading2"><a href="#Subtitle-with-some-modifiers">Subtitle with some modifiers</a></li>' +
'<li class="heading1"><a href="#Another-title">Another title</a></li>' +
'<li class="heading2"><a href="#An-Internet-link-inside-subtitle">An Internet link inside subtitle</a></li>' +
'<li class="heading2"><a href="#Project-Name">Project Name</a></li>' +
'</ul>'
+ @project = Project.find(1)
+ assert textilizable(raw).gsub("\n", "").include?(expected)
+ end
+
+ def test_table_of_content_should_contain_included_page_headings
+ raw = <<-RAW
+{{toc}}
+
+h1. Included
+
+{{include(Child_1)}}
+RAW
+
+ expected = '<ul class="toc">' +
+ '<li class="heading1"><a href="#Included">Included</a></li>' +
+ '<li class="heading1"><a href="#Child-page-1">Child page 1</a></li>' +
+ '</ul>'
+
+ @project = Project.find(1)
assert textilizable(raw).gsub("\n", "").include?(expected)
end