From: Toshi MARUYAMA Date: Wed, 5 Feb 2014 08:56:35 +0000 (+0000) Subject: Rails4: replace hard-coded html with class at ApplicationHelperTest#test_wiki_links_a... X-Git-Tag: 2.5.0~77 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=325b3db1860077178886f05ed5777d4ed4c52fa1;p=redmine.git Rails4: replace hard-coded html with class at ApplicationHelperTest#test_wiki_links_anchor_option_should_prepend_page_title_to_href See r12784 comment. git-svn-id: http://svn.redmine.org/redmine/trunk@12823 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb index 4f5a06390..9dc9de5e7 100644 --- a/test/unit/helpers/application_helper_test.rb +++ b/test/unit/helpers/application_helper_test.rb @@ -706,23 +706,46 @@ RAW end def test_wiki_links_anchor_option_should_prepend_page_title_to_href - to_test = { # link to a page - '[[CookBook documentation]]' => 'CookBook documentation', - '[[CookBook documentation|documentation]]' => 'documentation', - '[[CookBook documentation#One-section]]' => 'CookBook documentation', - '[[CookBook documentation#One-section|documentation]]' => 'documentation', + '[[CookBook documentation]]' => + link_to("CookBook documentation", + "#CookBook_documentation", + :class => "wiki-page"), + '[[CookBook documentation|documentation]]' => + link_to("documentation", + "#CookBook_documentation", + :class => "wiki-page"), + '[[CookBook documentation#One-section]]' => + link_to("CookBook documentation", + "#CookBook_documentation_One-section", + :class => "wiki-page"), + '[[CookBook documentation#One-section|documentation]]' => + link_to("documentation", + "#CookBook_documentation_One-section", + :class => "wiki-page"), # page that doesn't exist - '[[Unknown page]]' => 'Unknown page', - '[[Unknown page|404]]' => '404', - '[[Unknown page#anchor]]' => 'Unknown page', - '[[Unknown page#anchor|404]]' => '404', + '[[Unknown page]]' => + link_to("Unknown page", + "#Unknown_page", + :class => "wiki-page new"), + '[[Unknown page|404]]' => + link_to("404", + "#Unknown_page", + :class => "wiki-page new"), + '[[Unknown page#anchor]]' => + link_to("Unknown page", + "#Unknown_page_anchor", + :class => "wiki-page new"), + '[[Unknown page#anchor|404]]' => + link_to("404", + "#Unknown_page_anchor", + :class => "wiki-page new"), } - @project = Project.find(1) - - to_test.each { |text, result| assert_equal "

#{result}

", textilizable(text, :wiki_links => :anchor) } + to_test.each do |text, result| + assert_equal "

#{result}

", textilizable(text, :wiki_links => :anchor) + end end def test_html_tags