diff --git a/spec/components/email/receiver_spec.rb b/spec/components/email/receiver_spec.rb index 96c81c656e2..1ae5e656b36 100644 --- a/spec/components/email/receiver_spec.rb +++ b/spec/components/email/receiver_spec.rb @@ -818,6 +818,16 @@ describe Email::Receiver do expect { process(:mailinglist_reply) }.to change { topic.posts.count } end + it "should skip validations for staged users" do + Fabricate(:user, email: "alice@foo.com", staged: true) + expect { process(:mailinglist_short_message) }.to change { Topic.count } + end + + it "should skip validations for regular users" do + Fabricate(:user, email: "alice@foo.com") + expect { process(:mailinglist_short_message) }.to change { Topic.count } + end + context "read-only category" do before do category.set_permissions(everyone: :readonly) diff --git a/spec/fixtures/emails/mailinglist_short_message.eml b/spec/fixtures/emails/mailinglist_short_message.eml new file mode 100644 index 00000000000..b14209fce97 --- /dev/null +++ b/spec/fixtures/emails/mailinglist_short_message.eml @@ -0,0 +1,12 @@ +From: alice@foo.com +To: list@example.com +Subject: test +Date: Mon, 16 Oct 2017 09:18:32 +0100 +Message-ID: +Precedence: list +List-Id: Example List +Content-Transfer-Encoding: 7bit +Content-Type: text/plain; charset="us-ascii" +Sender: list-bounces@example.com + +Hello world!