2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-05 08:59:27 +08:00

FIX: UX improvements for system messages when PMs are disabled

This commit is contained in:
Robin Ward 2018-01-23 13:11:39 -05:00
parent 28d432263e
commit 782d75069e
6 changed files with 40 additions and 3 deletions

View file

@ -857,6 +857,25 @@ describe Guardian do
end
end
context "system message" do
let(:private_message) {
Fabricate(
:topic,
archetype: Archetype.private_message,
subtype: 'system_message',
category_id: nil
)
}
before { user.save! }
it "allows the user to reply to system messages" do
expect(Guardian.new(user).can_create_post?(private_message)).to eq(true)
SiteSetting.enable_system_message_replies = false
expect(Guardian.new(user).can_create_post?(private_message)).to eq(false)
end
end
context "private message" do
let(:private_message) { Fabricate(:topic, archetype: Archetype.private_message, category_id: nil) }