modreports: log modaction when report is handled or rejected.

This commit is contained in:
evazion
2022-01-20 21:28:29 -06:00
parent c8d27c2719
commit 5fd0d498a4
8 changed files with 22 additions and 3 deletions

View File

@@ -254,6 +254,7 @@ class CommentsControllerTest < ActionDispatch::IntegrationTest
assert_equal(true, @comment.reload.is_deleted)
assert_equal(true, report1.reload.handled?)
assert_equal(true, report2.reload.rejected?)
assert_equal(1, ModAction.moderation_report_handled.where(creator: @mod).count)
end
end

View File

@@ -239,6 +239,7 @@ class ForumPostsControllerTest < ActionDispatch::IntegrationTest
assert_equal(true, @forum_post.reload.is_deleted?)
assert_equal(true, report1.reload.handled?)
assert_equal(true, report2.reload.rejected?)
assert_equal(1, ModAction.moderation_report_handled.where(creator: @mod).count)
end
end

View File

@@ -120,6 +120,7 @@ class ModerationReportsControllerTest < ActionDispatch::IntegrationTest
assert_response :success
assert_equal("handled", report.reload.status)
assert_equal(true, @user.dmails.received.exists?(from: User.system, title: "Thank you for reporting comment ##{@comment.id}"))
assert_equal(true, ModAction.moderation_report_handled.where(creator: @mod).exists?)
end
should "allow a moderator to mark a moderation report as rejected" do
@@ -129,6 +130,7 @@ class ModerationReportsControllerTest < ActionDispatch::IntegrationTest
assert_response :success
assert_equal("rejected", report.reload.status)
assert_equal(false, @user.dmails.received.exists?(from: User.system))
assert_equal(true, ModAction.moderation_report_rejected.where(creator: @mod).exists?)
end
end
end