]> source.dussan.org Git - redmine.git/commitdiff
Rails4: replace hard-coded html with class at ApplicationHelperTest#test_attachment_links
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Wed, 5 Feb 2014 04:14:58 +0000 (04:14 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Wed, 5 Feb 2014 04:14:58 +0000 (04:14 +0000)
See r12784 comment.

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

test/unit/helpers/application_helper_test.rb

index e4c2e6a36d675c7505e9f985744d41c034c7476e..09cd916239f0859cfa1a59f91f8cd146d6ff9e2d 100644 (file)
@@ -580,10 +580,13 @@ RAW
   end
 
   def test_attachment_links
-    to_test = {
-      'attachment:error281.txt' => '<a href="/attachments/download/1/error281.txt" class="attachment">error281.txt</a>'
-    }
-    to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text, :attachments => Issue.find(3).attachments), "#{text} failed" }
+    text = 'attachment:error281.txt'
+    result = link_to("error281.txt", "/attachments/download/1/error281.txt",
+                     :class => "attachment")
+    assert_equal "<p>#{result}</p>",
+                 textilizable(text,
+                              :attachments => Issue.find(3).attachments),
+                 "#{text} failed"
   end
 
   def test_attachment_link_should_link_to_latest_attachment