mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Remove usages of enable_personal_messages (#18437)
cf. e62e93f83a
This PR also makes it so `bot` (negative ID) and `system` users are always allowed
to send PMs, since the old conditional was just based on `enable_personal_messages`
This commit is contained in:
@@ -410,6 +410,7 @@ RSpec.describe TopicCreator do
|
||||
TopicCreator.any_instance.expects(:watch_topic).returns(true)
|
||||
SiteSetting.allow_duplicate_topic_titles = true
|
||||
SiteSetting.enable_staged_users = true
|
||||
Group.refresh_automatic_groups!
|
||||
end
|
||||
|
||||
it "should be possible for a regular user to send private message" do
|
||||
@@ -442,7 +443,6 @@ RSpec.describe TopicCreator do
|
||||
end
|
||||
|
||||
it "personal_message_enabled_groups setting should be checked when sending private message" do
|
||||
SiteSetting.enable_personal_messages = false
|
||||
SiteSetting.personal_message_enabled_groups = Group::AUTO_GROUPS[:trust_level_4]
|
||||
|
||||
expect do
|
||||
@@ -452,6 +452,10 @@ RSpec.describe TopicCreator do
|
||||
end
|
||||
|
||||
context 'with to emails' do
|
||||
before do
|
||||
Group.refresh_automatic_groups!
|
||||
end
|
||||
|
||||
it 'works for staff' do
|
||||
SiteSetting.min_trust_to_send_email_messages = 'staff'
|
||||
expect(TopicCreator.create(admin, Guardian.new(admin), pm_to_email_valid_attrs)).to be_valid
|
||||
|
Reference in New Issue
Block a user