]> source.dussan.org Git - redmine.git/commitdiff
Rails4: replace hard-coded html with class at IssuesHelperTest
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Tue, 11 Feb 2014 07:27:30 +0000 (07:27 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Tue, 11 Feb 2014 07:27:30 +0000 (07:27 +0000)
See r12784 comment.

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

test/unit/helpers/issues_helper_test.rb

index fd574db9150bbe2e5ca807ec3f8d5e63aa834b22..2737553387556ba0a8887a6503cf22a1af4bd267 100644 (file)
@@ -216,8 +216,9 @@ class IssuesHelperTest < ActionView::TestCase
                                :prop_key => 'precedes',
                                :value    => 1)
     assert_equal "Precedes Bug #1: Can't print recipes added", show_detail(detail, true)
-    assert_match %r{<strong>Precedes</strong> <i><a href="/issues/1" class=".+">Bug #1</a>: #{ESCAPED_UCANT} print recipes</i> added},
-                 show_detail(detail, false)
+    str = link_to("Bug #1", "/issues/1", :class => Issue.find(1).css_classes)
+    assert_equal "<strong>Precedes</strong> <i>#{str}: #{ESCAPED_UCANT} print recipes</i> added",
+                  show_detail(detail, false)
   end
 
   def test_show_detail_relation_added_with_inexistant_issue
@@ -245,7 +246,10 @@ class IssuesHelperTest < ActionView::TestCase
                                :prop_key  => 'precedes',
                                :old_value => 1)
     assert_equal "Precedes deleted (Bug #1: Can't print recipes)", show_detail(detail, true)
-    assert_match %r{<strong>Precedes</strong> deleted \(<i><a href="/issues/1" class=".+">Bug #1</a>: #{ESCAPED_UCANT} print recipes</i>\)},
+    str = link_to("Bug #1",
+                  "/issues/1",
+                  :class => Issue.find(1).css_classes)
+    assert_equal "<strong>Precedes</strong> deleted (<i>#{str}: #{ESCAPED_UCANT} print recipes</i>)",
                  show_detail(detail, false)
   end