- assert_equal "deleted", note_author(users(:deleted_user))
- assert_equal "<a href=\"/user/test2\">test2</a>", note_author(users(:public_user))
- assert_equal "<a href=\"http://test.host/user/test2\">test2</a>", note_author(users(:public_user), :only_path => false)
+ assert_equal "deleted", note_author(deleted_user)
+ assert_equal "<a href=\"/user/#{ERB::Util.u(user.display_name)}\">#{user.display_name}</a>", note_author(user)
+ assert_equal "<a href=\"http://test.host/user/#{ERB::Util.u(user.display_name)}\">#{user.display_name}</a>", note_author(user, :only_path => false)
+ end
+
+ def test_disappear_in
+ note_closed_date = Time.new(2022, 1, 1, 12, 0, 0, "+00:00")
+ note = create(:note, :closed_at => note_closed_date)
+
+ travel_to note_closed_date + 1.day do
+ assert_match %r{^<span title=" 8 January 2022 at 12:00">6 days</span>$}, disappear_in(note)
+ end