mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 03:06:53 +08:00
FIX: Allow user actions to be saved even if the post has nil user
This issue made it impossible to delete users if they had flagged a post with nil user
This commit is contained in:
@ -477,6 +477,15 @@ describe PostAction do
|
||||
expect(post.topic.visible).to eq(false)
|
||||
end
|
||||
|
||||
it "doesn't fail when post has nil user" do
|
||||
post = create_post
|
||||
post.update!(user: nil)
|
||||
|
||||
PostAction.act(codinghorror, post, PostActionType.types[:spam], take_action: true)
|
||||
post.reload
|
||||
expect(post.hidden).to eq(true)
|
||||
end
|
||||
|
||||
it "hide tl0 posts that are flagged as spam by a tl3 user" do
|
||||
newuser = Fabricate(:newuser)
|
||||
post = create_post(user: newuser)
|
||||
|
Reference in New Issue
Block a user