Merge pull request #5807 from discourse/min-flags-by-topic

FEATURE: New site setting `min_flags_staff_visibility`
This commit is contained in:
Robin Ward
2018-05-08 09:17:29 -04:00
committed by GitHub
6 changed files with 99 additions and 9 deletions

View File

@@ -141,6 +141,17 @@ describe PostAction do
expect(PostAction.flagged_posts_count).to eq(0)
end
it "respects min_flags_staff_visibility" do
SiteSetting.min_flags_staff_visibility = 2
expect(PostAction.flagged_posts_count).to eq(0)
PostAction.act(codinghorror, post, PostActionType.types[:off_topic])
expect(PostAction.flagged_posts_count).to eq(0)
PostAction.act(eviltrout, post, PostActionType.types[:off_topic])
expect(PostAction.flagged_posts_count).to eq(1)
end
it "should reset counts when a topic is deleted" do
PostAction.act(codinghorror, post, PostActionType.types[:off_topic])
post.topic.trash!