Rails4: replace hard-coded html with class at Redmine::WikiFormatting::MacrosTest

See r12784 comment.

git-svn-id: http://svn.redmine.org/redmine/trunk@12876 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2014-02-13 05:40:09 +00:00
parent b1c151f6c3
commit 2fc8ede093
1 changed files with 18 additions and 6 deletions

View File

@ -286,18 +286,30 @@ class Redmine::WikiFormatting::MacrosTest < ActionView::TestCase
end
def test_macro_thumbnail
assert_equal '<p><a href="/attachments/17" class="thumbnail" title="testfile.PNG"><img alt="testfile.PNG" src="/attachments/thumbnail/17" /></a></p>',
textilizable("{{thumbnail(testfile.png)}}", :object => Issue.find(14))
link = link_to('<img alt="testfile.PNG" src="/attachments/thumbnail/17" />'.html_safe,
"/attachments/17",
:class => "thumbnail",
:title => "testfile.PNG")
assert_equal "<p>#{link}</p>",
textilizable("{{thumbnail(testfile.png)}}", :object => Issue.find(14))
end
def test_macro_thumbnail_with_size
assert_equal '<p><a href="/attachments/17" class="thumbnail" title="testfile.PNG"><img alt="testfile.PNG" src="/attachments/thumbnail/17/200" /></a></p>',
textilizable("{{thumbnail(testfile.png, size=200)}}", :object => Issue.find(14))
link = link_to('<img alt="testfile.PNG" src="/attachments/thumbnail/17/200" />'.html_safe,
"/attachments/17",
:class => "thumbnail",
:title => "testfile.PNG")
assert_equal "<p>#{link}</p>",
textilizable("{{thumbnail(testfile.png, size=200)}}", :object => Issue.find(14))
end
def test_macro_thumbnail_with_title
assert_equal '<p><a href="/attachments/17" class="thumbnail" title="Cool image"><img alt="testfile.PNG" src="/attachments/thumbnail/17" /></a></p>',
textilizable("{{thumbnail(testfile.png, title=Cool image)}}", :object => Issue.find(14))
link = link_to('<img alt="testfile.PNG" src="/attachments/thumbnail/17" />'.html_safe,
"/attachments/17",
:class => "thumbnail",
:title => "Cool image")
assert_equal "<p>#{link}</p>",
textilizable("{{thumbnail(testfile.png, title=Cool image)}}", :object => Issue.find(14))
end
def test_macro_thumbnail_with_invalid_filename_should_fail