]> git.openstreetmap.org Git - rails.git/blobdiff - test/helpers/application_helper_test.rb
Change tests to expect a successful (empty) response even if the user is not visible...
[rails.git] / test / helpers / application_helper_test.rb
index d3e4d4f072b3006a53bed6a36f95063f665d95d5..7cd6bce89417fb40ae497c1debdc032817d2ab90 100644 (file)
@@ -8,11 +8,11 @@ class ApplicationHelperTest < ActionView::TestCase
       text = "Test #{link} is <b>made</b> into a link"
 
       html = linkify(text)
-      assert html.html_safe?
+      assert_predicate html, :html_safe?
       assert_dom_equal "Test <a href=\"#{link}\" rel=\"nofollow\">#{link}</a> is &lt;b&gt;made&lt;/b&gt; into a link", html
 
       html = linkify(text.html_safe)
-      assert html.html_safe?
+      assert_predicate html, :html_safe?
       assert_dom_equal "Test <a href=\"#{link}\" rel=\"nofollow\">#{link}</a> is <b>made</b> into a link", html
     end
 
@@ -20,11 +20,11 @@ class ApplicationHelperTest < ActionView::TestCase
       text = "Test #{link} is not <b>made</b> into a link"
 
       html = linkify(text)
-      assert html.html_safe?
+      assert_predicate html, :html_safe?
       assert_dom_equal "Test #{link} is not &lt;b&gt;made&lt;/b&gt; into a link", html
 
       html = linkify(text.html_safe)
-      assert html.html_safe?
+      assert_predicate html, :html_safe?
       assert_dom_equal "Test #{link} is not <b>made</b> into a link", html
     end
   end
@@ -56,7 +56,7 @@ class ApplicationHelperTest < ActionView::TestCase
   end
 
   def test_friendly_date
-    date = friendly_date(Time.new(2014, 3, 5, 18, 58, 23).utc)
+    date = friendly_date(Time.utc(2014, 3, 5, 18, 58, 23))
     assert_match %r{^<span title=" *5 March 2014 at 18:58">.*</span>$}, date
 
     date = friendly_date(Time.now.utc - 1.hour)