summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorEtienne Massip <etienne.massip@gmail.com>2011-10-02 17:25:29 +0000
committerEtienne Massip <etienne.massip@gmail.com>2011-10-02 17:25:29 +0000
commit65b533a8ec1f4d53a082cdc76324f65147d6f6b1 (patch)
tree11168c96153e966c313d9e7ac10a72c70c677efe /test
parent8bb90f87fb73e2f21a45ba213c59f31a93311b78 (diff)
downloadredmine-65b533a8ec1f4d53a082cdc76324f65147d6f6b1.tar.gz
redmine-65b533a8ec1f4d53a082cdc76324f65147d6f6b1.zip
Make sure that anchor names generated for headings fully match wiki links (#7215).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7563 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/unit/helpers/application_helper_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb
index db18f8aa8..1d848bb71 100644
--- a/test/unit/helpers/application_helper_test.rb
+++ b/test/unit/helpers/application_helper_test.rb
@@ -553,6 +553,16 @@ EXPECTED
assert_equal expected, textilizable(raw)
end
+ def test_headings_with_special_chars
+ # This test makes sure that the generated anchor names match the expected
+ # ones even if the heading text contains unconventional characters
+ raw = 'h1. Some heading related to version 0.5'
+ anchor = sanitize_anchor_name("Some-heading-related-to-version-0.5")
+ expected = %|<a name="#{anchor}"></a>\n<h1 >Some heading related to version 0.5<a href="##{anchor}" class="wiki-anchor">&para;</a></h1>|
+
+ assert_equal expected, textilizable(raw)
+ end
+
def test_wiki_links_within_wiki_page_context
page = WikiPage.find_by_title('Another_page' )