feedbacks: don't send redundant dmails when user is banned or loses approver status.

When a user is banned, send them a "You have been banned" dmail instead of a "Your user record has
been updated" dmail.

When a user loses approver status due to inactivity, don't seen them a "Your user record has been
updated" dmail for the "Lost approver privileges" neutral feedback they receive.
This commit is contained in:
evazion
2022-11-20 16:39:36 -06:00
parent bbe32f5e5d
commit 001ce99dd3
4 changed files with 23 additions and 10 deletions

View File

@@ -10,6 +10,8 @@ class ApproverPrunerTest < ActiveSupport::TestCase
assert_equal([@approver.id], ApproverPruner.inactive_approvers.map(&:id))
assert_nothing_raised { ApproverPruner.prune! }
assert_equal(User::Levels::CONTRIBUTOR, @approver.reload.level)
assert_equal(1, @approver.dmails.received.count)
assert_equal("Approver inactivity", @approver.dmails.received.last.title)
end
should "not demote active approvers" do