diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb index ba3eec7c2..2c1edb0aa 100644 --- a/test/unit/helpers/application_helper_test.rb +++ b/test/unit/helpers/application_helper_test.rb @@ -632,23 +632,38 @@ RAW end def test_wiki_links_within_local_file_generation_context - 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.html", + :class => "wiki-page"), + '[[CookBook documentation|documentation]]' => + link_to("documentation", "CookBook_documentation.html", + :class => "wiki-page"), + '[[CookBook documentation#One-section]]' => + link_to("CookBook documentation", "CookBook_documentation.html#One-section", + :class => "wiki-page"), + '[[CookBook documentation#One-section|documentation]]' => + link_to("documentation", "CookBook_documentation.html#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.html", + :class => "wiki-page new"), + '[[Unknown page|404]]' => + link_to("404", "Unknown_page.html", + :class => "wiki-page new"), + '[[Unknown page#anchor]]' => + link_to("Unknown page", "Unknown_page.html#anchor", + :class => "wiki-page new"), + '[[Unknown page#anchor|404]]' => + link_to("404", "Unknown_page.html#anchor", + :class => "wiki-page new"), } - @project = Project.find(1) - - to_test.each { |text, result| assert_equal "

#{result}

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

#{result}

", textilizable(text, :wiki_links => :local) + end end def test_wiki_links_within_wiki_page_context