Report deactivates_at as block read date
This commit is contained in:
parent
1ca2c2837e
commit
3df14c5a40
2 changed files with 11 additions and 2 deletions
|
@ -35,7 +35,7 @@ module UserBlocksHelper
|
|||
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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue