mirror of
https://github.com/discourse/discourse.git
synced 2025-02-20 23:39:23 +08:00
Merge pull request #3012 from techAPJ/patch-2
Add test for email with inline reply
This commit is contained in:
commit
77a775ecd2
@ -102,6 +102,53 @@ It will also be my *only* reply."
|
||||
)
|
||||
end
|
||||
|
||||
it "handles inline reply" do
|
||||
test_parse_body(fixture_file("emails/inline_reply.eml")).
|
||||
should == (
|
||||
"On Wed, Oct 8, 2014 at 11:12 AM, techAPJ <info@unconfigured.discourse.org> wrote:
|
||||
|
||||
> techAPJ <https://meta.discourse.org/users/techapj>
|
||||
> November 28
|
||||
>
|
||||
> Test reply.
|
||||
>
|
||||
> First paragraph.
|
||||
>
|
||||
> Second paragraph.
|
||||
>
|
||||
> To respond, reply to this email or visit
|
||||
> https://meta.discourse.org/t/testing-default-email-replies/22638/3 in
|
||||
> your browser.
|
||||
> ------------------------------
|
||||
> Previous Replies codinghorror
|
||||
> <https://meta.discourse.org/users/codinghorror>
|
||||
> November 28
|
||||
>
|
||||
> We're testing the latest GitHub email processing library which we are
|
||||
> integrating now.
|
||||
>
|
||||
> https://github.com/github/email_reply_parser
|
||||
>
|
||||
> Go ahead and reply to this topic and I'll reply from various email clients
|
||||
> for testing.
|
||||
> ------------------------------
|
||||
>
|
||||
> To respond, reply to this email or visit
|
||||
> https://meta.discourse.org/t/testing-default-email-replies/22638/3 in
|
||||
> your browser.
|
||||
>
|
||||
> To unsubscribe from these emails, visit your user preferences
|
||||
> <https://meta.discourse.org/my/preferences>.
|
||||
>
|
||||
|
||||
The quick brown fox jumps over the lazy dog. The quick brown fox jumps over
|
||||
the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown
|
||||
fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.
|
||||
The quick brown fox jumps over the lazy dog. The quick brown fox jumps over
|
||||
the lazy dog. The quick brown fox jumps over the lazy dog."
|
||||
)
|
||||
end
|
||||
|
||||
it "should not include previous replies" do
|
||||
test_parse_body(fixture_file("emails/previous_replies.eml")).should_not match /Previous Replies/
|
||||
end
|
||||
|
60
spec/fixtures/emails/inline_reply.eml
vendored
Normal file
60
spec/fixtures/emails/inline_reply.eml
vendored
Normal file
@ -0,0 +1,60 @@
|
||||
|
||||
MIME-Version: 1.0
|
||||
In-Reply-To: <reply@discourse-app.mail>
|
||||
References: <topic/36@discourse.techapj.com>
|
||||
<5434ced4ee0f9_663fb0b5f76070593b@discourse-app.mail>
|
||||
Date: Mon, 1 Dec 2014 20:48:40 +0530
|
||||
Delivered-To: someone@googlemail.com
|
||||
Subject: Re: [Discourse] [Meta] Testing reply via email
|
||||
From: Walter White <walter.white@googlemail.com>
|
||||
To: Discourse <reply@mail.com>
|
||||
Content-Type: multipart/alternative; boundary=20cf30363f8522466905092920a6
|
||||
|
||||
--20cf30363f8522466905092920a6
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: quoted-printable
|
||||
|
||||
On Wed, Oct 8, 2014 at 11:12 AM, techAPJ <info@unconfigured.discourse.org>
|
||||
wrote:
|
||||
|
||||
> techAPJ <https://meta.discourse.org/users/techapj>
|
||||
> November 28
|
||||
>
|
||||
> Test reply.
|
||||
>
|
||||
> First paragraph.
|
||||
>
|
||||
> Second paragraph.
|
||||
>
|
||||
> To respond, reply to this email or visit
|
||||
> https://meta.discourse.org/t/testing-default-email-replies/22638/3 in
|
||||
> your browser.
|
||||
> ------------------------------
|
||||
> Previous Replies codinghorror
|
||||
> <https://meta.discourse.org/users/codinghorror>
|
||||
> November 28
|
||||
>
|
||||
> We're testing the latest GitHub email processing library which we are
|
||||
> integrating now.
|
||||
>
|
||||
> https://github.com/github/email_reply_parser
|
||||
>
|
||||
> Go ahead and reply to this topic and I'll reply from various email clients
|
||||
> for testing.
|
||||
> ------------------------------
|
||||
>
|
||||
> To respond, reply to this email or visit
|
||||
> https://meta.discourse.org/t/testing-default-email-replies/22638/3 in
|
||||
> your browser.
|
||||
>
|
||||
> To unsubscribe from these emails, visit your user preferences
|
||||
> <https://meta.discourse.org/my/preferences>.
|
||||
>
|
||||
|
||||
The quick brown fox jumps over the lazy dog. The quick brown fox jumps over
|
||||
the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown
|
||||
fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.
|
||||
The quick brown fox jumps over the lazy dog. The quick brown fox jumps over
|
||||
the lazy dog. The quick brown fox jumps over the lazy dog.
|
||||
|
||||
--20cf30363f8522466905092920a6--
|
Loading…
x
Reference in New Issue
Block a user