mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Allow posting via email to read-only mailing list mirror category
This commit is contained in:
@@ -798,12 +798,12 @@ describe Email::Receiver do
|
||||
end
|
||||
end
|
||||
|
||||
context "mailinglist mirror" do
|
||||
context "mailing list mirror" do
|
||||
let!(:category) { Fabricate(:mailinglist_mirror_category) }
|
||||
|
||||
before do
|
||||
SiteSetting.block_auto_generated_emails = true
|
||||
SiteSetting.find_related_post_with_key = true
|
||||
|
||||
Fabricate(:mailinglist_mirror_category)
|
||||
end
|
||||
|
||||
it "should allow creating topic even when email is autogenerated" do
|
||||
@@ -817,5 +817,26 @@ describe Email::Receiver do
|
||||
|
||||
expect { process(:mailinglist_reply) }.to change { topic.posts.count }
|
||||
end
|
||||
|
||||
context "read-only category" do
|
||||
before do
|
||||
category.set_permissions(everyone: :readonly)
|
||||
category.save
|
||||
|
||||
Fabricate(:user, email: "alice@foo.com")
|
||||
Fabricate(:user, email: "bob@bar.com")
|
||||
end
|
||||
|
||||
it "should allow creating topic within read-only category" do
|
||||
expect { process(:mailinglist) }.to change { Topic.count }
|
||||
end
|
||||
|
||||
it "should allow replying within read-only category" do
|
||||
process(:mailinglist)
|
||||
topic = Topic.last
|
||||
|
||||
expect { process(:mailinglist_reply) }.to change { topic.posts.count }
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user