Rails4: replace hard-coded html with class at ApplicationHelperTest#test_wiki_links_in_tables
See r12784 comment. git-svn-id: http://svn.redmine.org/redmine/trunk@12811 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
f21aeaeb7b
commit
2f43fca8f0
|
@ -833,13 +833,15 @@ EXPECTED
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_wiki_links_in_tables
|
def test_wiki_links_in_tables
|
||||||
to_test = {"|[[Page|Link title]]|[[Other Page|Other title]]|\n|Cell 21|[[Last page]]|" =>
|
text = "|[[Page|Link title]]|[[Other Page|Other title]]|\n|Cell 21|[[Last page]]|"
|
||||||
'<tr><td><a href="/projects/ecookbook/wiki/Page" class="wiki-page new">Link title</a></td>' +
|
link1 = link_to("Link title", "/projects/ecookbook/wiki/Page", :class => "wiki-page new")
|
||||||
'<td><a href="/projects/ecookbook/wiki/Other_Page" class="wiki-page new">Other title</a></td>' +
|
link2 = link_to("Other title", "/projects/ecookbook/wiki/Other_Page", :class => "wiki-page new")
|
||||||
'</tr><tr><td>Cell 21</td><td><a href="/projects/ecookbook/wiki/Last_page" class="wiki-page new">Last page</a></td></tr>'
|
link3 = link_to("Last page", "/projects/ecookbook/wiki/Last_page", :class => "wiki-page new")
|
||||||
}
|
result = "<tr><td>#{link1}</td>" +
|
||||||
|
"<td>#{link2}</td>" +
|
||||||
|
"</tr><tr><td>Cell 21</td><td>#{link3}</td></tr>"
|
||||||
@project = Project.find(1)
|
@project = Project.find(1)
|
||||||
to_test.each { |text, result| assert_equal "<table>#{result}</table>", textilizable(text).gsub(/[\t\n]/, '') }
|
assert_equal "<table>#{result}</table>", textilizable(text).gsub(/[\t\n]/, '')
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_text_formatting
|
def test_text_formatting
|
||||||
|
|
Loading…
Reference in New Issue