mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 01:14:29 +08:00
New Feature: Staff can choose to "Take Action" when flagging to immediately reach hiding
thresholds.
This commit is contained in:
@ -21,7 +21,7 @@ describe PostAction do
|
||||
|
||||
it "notify moderators integration test" do
|
||||
mod = moderator
|
||||
action = PostAction.act(codinghorror, post, PostActionType.types[:notify_moderators], "this is my special long message");
|
||||
action = PostAction.act(codinghorror, post, PostActionType.types[:notify_moderators], message: "this is my special long message");
|
||||
|
||||
posts = Post.joins(:topic)
|
||||
.select('posts.id, topics.subtype, posts.topic_id')
|
||||
@ -50,7 +50,7 @@ describe PostAction do
|
||||
it "sends an email to all moderators if selected" do
|
||||
post = build(:post, id: 1000)
|
||||
PostCreator.any_instance.expects(:create).returns(post)
|
||||
PostAction.act(build(:user), build(:post), PostActionType.types[:notify_moderators], "this is my special message");
|
||||
PostAction.act(build(:user), build(:post), PostActionType.types[:notify_moderators], message: "this is my special message");
|
||||
end
|
||||
end
|
||||
|
||||
@ -63,7 +63,7 @@ describe PostAction do
|
||||
|
||||
it "sends an email to user if selected" do
|
||||
PostCreator.any_instance.expects(:create).returns(build(:post))
|
||||
PostAction.act(build(:user), post, PostActionType.types[:notify_user], "this is my special message");
|
||||
PostAction.act(build(:user), post, PostActionType.types[:notify_user], message: "this is my special message");
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -179,9 +179,9 @@ describe PostAction do
|
||||
flag = PostAction.act(Fabricate(:evil_trout), post, PostActionType.types[:spam])
|
||||
PostAction.flag_counts_for(post.id).should == [0, 1]
|
||||
|
||||
# If an admin flags the post, it is counted higher
|
||||
# If staff takes action, it is ranked higher
|
||||
admin = Fabricate(:admin)
|
||||
PostAction.act(admin, post, PostActionType.types[:spam])
|
||||
pa = PostAction.act(admin, post, PostActionType.types[:spam], take_action: true)
|
||||
PostAction.flag_counts_for(post.id).should == [0, 8]
|
||||
|
||||
# If a flag is dismissed
|
||||
|
Reference in New Issue
Block a user