mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 19:39:30 +08:00
Revert "FIX: TL0 users' messages to moderators were not being posted when flagging private messages"
This commit is contained in:
@ -154,22 +154,9 @@ describe Guardian do
|
||||
expect(Guardian.new(user).can_send_private_message?(user)).to be_truthy
|
||||
end
|
||||
|
||||
context "when user is untrusted " do
|
||||
before do
|
||||
user.trust_level = TrustLevel[0]
|
||||
end
|
||||
|
||||
it "returns false to another user" do
|
||||
expect(Guardian.new(user).can_send_private_message?(another_user)).to be_falsey
|
||||
end
|
||||
|
||||
it "returns true to moderator user" do
|
||||
expect(Guardian.new(user).can_send_private_message?(moderator)).to be_truthy
|
||||
end
|
||||
|
||||
it "returns true to moderator group" do
|
||||
expect(Guardian.new(user).can_send_private_message?(Group[:moderators])).to be_truthy
|
||||
end
|
||||
it "returns false when you are untrusted" do
|
||||
user.trust_level = TrustLevel[0]
|
||||
expect(Guardian.new(user).can_send_private_message?(another_user)).to be_falsey
|
||||
end
|
||||
|
||||
it "returns true to another user" do
|
||||
@ -193,10 +180,6 @@ describe Guardian do
|
||||
expect(Guardian.new(moderator).can_send_private_message?(another_user)).to be_truthy
|
||||
expect(Guardian.new(admin).can_send_private_message?(another_user)).to be_truthy
|
||||
end
|
||||
|
||||
it "returns false even to a moderator" do
|
||||
expect(Guardian.new(trust_level_4).can_send_private_message?(moderator)).to be_falsey
|
||||
end
|
||||
end
|
||||
|
||||
context "target user is suspended" do
|
||||
|
Reference in New Issue
Block a user