]> git.openstreetmap.org Git - rails.git/blobdiff - test/helpers/user_blocks_helper_test.rb
Report deactivates_at as block read date
[rails.git] / test / helpers / user_blocks_helper_test.rb
index 28cc0ad5055cdd530a861164d5c8bc3a87592c1c..d308f46ead1cc04cc9dbf0ed806a431824f0ce2d 100644 (file)
@@ -58,7 +58,16 @@ class UserBlocksHelperTest < ActionView::TestCase
 
       block.update(:needs_view => false, :deactivates_at => Time.now.utc)
 
-      assert_match "read at", block_short_status(block)
+      read_date = Time.now.utc.to_date.strftime
+      short_status_dom = Rails::Dom::Testing.html_document.parse(block_short_status(block))
+      assert_dom short_status_dom, ":root", :text => "read at #{read_date}"
+
+      travel 24.hours
+
+      block.update(:reason => "updated reason")
+
+      short_status_dom = Rails::Dom::Testing.html_document.parse(block_short_status(block))
+      assert_dom short_status_dom, ":root", :text => "read at #{read_date}"
     end
   end