mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 13:06:56 +08:00
FIX: Silenced users shouldn't be able to act on posts
This commit is contained in:
@ -104,6 +104,11 @@ describe Guardian do
|
||||
expect(Guardian.new(user).post_can_act?(post, :like)).to be_falsey
|
||||
end
|
||||
|
||||
it "returns false when the user is silenced" do
|
||||
UserSilencer.silence(user, admin)
|
||||
expect(Guardian.new(user).post_can_act?(post, :spam)).to be_falsey
|
||||
end
|
||||
|
||||
it "allows flagging archived posts" do
|
||||
post.topic.archived = true
|
||||
expect(Guardian.new(user).post_can_act?(post, :spam)).to be_truthy
|
||||
|
Reference in New Issue
Block a user