approver pruner: send weekly warning dmails to inactive approvers.

Send weekly warning dmails to approvers in danger of losing their
approver permissions. Don't send warnings if we're more than three weeks
away from demotion so that approvers aren't warned prematurely.
This commit is contained in:
evazion
2020-02-27 00:08:48 -06:00
parent 4b9a29743a
commit 3d410398a3
3 changed files with 24 additions and 0 deletions

View File

@@ -27,5 +27,13 @@ class ApproverPrunerTest < ActiveSupport::TestCase
assert_not_includes(ApproverPruner.inactive_approvers.map(&:id), @user.id)
end
should "dmail inactive approvers" do
travel_to(Date.parse("2020-01-20")) do
ApproverPruner.dmail_inactive_approvers!
end
assert_equal("You will lose approval privileges soon", @approver.dmails.received.last.title)
end
end
end