mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: A blocked user should not be able to moderate anything.
This commit is contained in:
@@ -1208,6 +1208,14 @@ describe Guardian do
|
||||
expect(Guardian.new(user).can_moderate?(nil)).to be_falsey
|
||||
end
|
||||
|
||||
context 'when user is blocked' do
|
||||
it 'returns false' do
|
||||
user.toggle!(:blocked)
|
||||
expect(Guardian.new(user).can_moderate?(post)).to be(false)
|
||||
expect(Guardian.new(user).can_moderate?(topic)).to be(false)
|
||||
end
|
||||
end
|
||||
|
||||
context 'a Topic' do
|
||||
|
||||
it 'returns false when not logged in' do
|
||||
|
||||
Reference in New Issue
Block a user