FIX: when private messages are disabled in settings, flag modal shouldn't show private message options

This commit is contained in:
Neil Lalonde
2014-12-19 16:47:39 -05:00
parent 043a93dfd5
commit 3cb25b019e
2 changed files with 13 additions and 0 deletions

View File

@@ -62,6 +62,13 @@ describe Guardian do
Guardian.new(user).post_can_act?(post, :off_topic, taken_actions: {PostActionType.types[:spam] => 1}).should be_falsey
end
it "returns false for notify_user if private messages are disabled" do
SiteSetting.stubs(:enable_private_messages).returns(false)
user.trust_level = TrustLevel[2]
Guardian.new(user).post_can_act?(post, :notify_user).should be_falsey
Guardian.new(user).post_can_act?(post, :notify_moderators).should be_falsey
end
describe "trust levels" do
it "returns true for a new user liking something" do
user.trust_level = TrustLevel[0]