]> source.dussan.org Git - redmine.git/commitdiff
Rails4: replace hard-coded html with class at Redmine::WikiFormatting::MacrosTest
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 13 Feb 2014 05:40:09 +0000 (05:40 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 13 Feb 2014 05:40:09 +0000 (05:40 +0000)
See r12784 comment.

git-svn-id: http://svn.redmine.org/redmine/trunk@12876 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/unit/lib/redmine/wiki_formatting/macros_test.rb

index d2dffb41c4f67439057c69414c05d552ede74527..772fa955506c3ab58fd08e6121d8c2963d702c76 100644 (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