##// END OF EJS Templates
Rails4: replace hard-coded html with class at ApplicationHelperTest#test_wiki_links_in_tables...
Toshi MARUYAMA -
r12536:2f43fca8f084
parent child
Show More
@@ -833,13 +833,15 EXPECTED
833 833 end
834 834
835 835 def test_wiki_links_in_tables
836 to_test = {"|[[Page|Link title]]|[[Other Page|Other title]]|\n|Cell 21|[[Last page]]|" =>
837 '<tr><td><a href="/projects/ecookbook/wiki/Page" class="wiki-page new">Link title</a></td>' +
838 '<td><a href="/projects/ecookbook/wiki/Other_Page" class="wiki-page new">Other title</a></td>' +
839 '</tr><tr><td>Cell 21</td><td><a href="/projects/ecookbook/wiki/Last_page" class="wiki-page new">Last page</a></td></tr>'
840 }
836 text = "|[[Page|Link title]]|[[Other Page|Other title]]|\n|Cell 21|[[Last page]]|"
837 link1 = link_to("Link title", "/projects/ecookbook/wiki/Page", :class => "wiki-page new")
838 link2 = link_to("Other title", "/projects/ecookbook/wiki/Other_Page", :class => "wiki-page new")
839 link3 = link_to("Last page", "/projects/ecookbook/wiki/Last_page", :class => "wiki-page new")
840 result = "<tr><td>#{link1}</td>" +
841 "<td>#{link2}</td>" +
842 "</tr><tr><td>Cell 21</td><td>#{link3}</td></tr>"
841 843 @project = Project.find(1)
842 to_test.each { |text, result| assert_equal "<table>#{result}</table>", textilizable(text).gsub(/[\t\n]/, '') }
844 assert_equal "<table>#{result}</table>", textilizable(text).gsub(/[\t\n]/, '')
843 845 end
844 846
845 847 def test_text_formatting
General Comments 0
You need to be logged in to leave comments. Login now