else
if block.revoker_id.nil?
if block.deactivates_at > block.ends_at
- t("user_blocks.helper.short.read_html", :time => block_short_time_in_past(block.updated_at))
+ t("user_blocks.helper.short.read_html", :time => block_short_time_in_past(block.deactivates_at))
else
t("user_blocks.helper.short.ended")
end
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