##// END OF EJS Templates
Rails4: use link_to instead of hard coded html at ApplicationHelperTest#test_wiki_links_within_local_file_generation_context...
Toshi MARUYAMA -
r12509:05b2bd173eef
parent child
Show More
@@ -632,23 +632,38 RAW
632 end
632 end
633
633
634 def test_wiki_links_within_local_file_generation_context
634 def test_wiki_links_within_local_file_generation_context
635
636 to_test = {
635 to_test = {
637 # link to a page
636 # link to a page
638 '[[CookBook documentation]]' => '<a href="CookBook_documentation.html" class="wiki-page">CookBook documentation</a>',
637 '[[CookBook documentation]]' =>
639 '[[CookBook documentation|documentation]]' => '<a href="CookBook_documentation.html" class="wiki-page">documentation</a>',
638 link_to("CookBook documentation", "CookBook_documentation.html",
640 '[[CookBook documentation#One-section]]' => '<a href="CookBook_documentation.html#One-section" class="wiki-page">CookBook documentation</a>',
639 :class => "wiki-page"),
641 '[[CookBook documentation#One-section|documentation]]' => '<a href="CookBook_documentation.html#One-section" class="wiki-page">documentation</a>',
640 '[[CookBook documentation|documentation]]' =>
641 link_to("documentation", "CookBook_documentation.html",
642 :class => "wiki-page"),
643 '[[CookBook documentation#One-section]]' =>
644 link_to("CookBook documentation", "CookBook_documentation.html#One-section",
645 :class => "wiki-page"),
646 '[[CookBook documentation#One-section|documentation]]' =>
647 link_to("documentation", "CookBook_documentation.html#One-section",
648 :class => "wiki-page"),
642 # page that doesn't exist
649 # page that doesn't exist
643 '[[Unknown page]]' => '<a href="Unknown_page.html" class="wiki-page new">Unknown page</a>',
650 '[[Unknown page]]' =>
644 '[[Unknown page|404]]' => '<a href="Unknown_page.html" class="wiki-page new">404</a>',
651 link_to("Unknown page", "Unknown_page.html",
645 '[[Unknown page#anchor]]' => '<a href="Unknown_page.html#anchor" class="wiki-page new">Unknown page</a>',
652 :class => "wiki-page new"),
646 '[[Unknown page#anchor|404]]' => '<a href="Unknown_page.html#anchor" class="wiki-page new">404</a>',
653 '[[Unknown page|404]]' =>
654 link_to("404", "Unknown_page.html",
655 :class => "wiki-page new"),
656 '[[Unknown page#anchor]]' =>
657 link_to("Unknown page", "Unknown_page.html#anchor",
658 :class => "wiki-page new"),
659 '[[Unknown page#anchor|404]]' =>
660 link_to("404", "Unknown_page.html#anchor",
661 :class => "wiki-page new"),
647 }
662 }
648
649 @project = Project.find(1)
663 @project = Project.find(1)
650
664 to_test.each do |text, result|
651 to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text, :wiki_links => :local) }
665 assert_equal "<p>#{result}</p>", textilizable(text, :wiki_links => :local)
666 end
652 end
667 end
653
668
654 def test_wiki_links_within_wiki_page_context
669 def test_wiki_links_within_wiki_page_context
General Comments 0
You need to be logged in to leave comments. Login now