Skip to content

Commit 2bdba4a

Browse files
committed
merge
2 parents 6daf769 + ebe7a03 commit 2bdba4a

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

test/email_reply_parser_test.rb

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,25 @@ def test_reads_bottom_post
6363
assert_match /^_/, reply.fragments[5].to_s
6464
end
6565

66+
def test_reads_inline_replies
67+
reply = email(:email_1_8)
68+
assert_equal 6, reply.fragments.size
69+
70+
assert_equal [true, false, true, false, false, false],
71+
reply.fragments.map { |f| f.quoted? }
72+
assert_equal [false, false, false, false, false, true],
73+
reply.fragments.map { |f| f.signature? }
74+
assert_equal [false, false, false, false, true, true],
75+
reply.fragments.map { |f| f.hidden? }
76+
77+
assert_match /^On [^\:]+\:/, reply.fragments[0].to_s
78+
assert_match /^I will reply/, reply.fragments[1].to_s
79+
assert_match /^> /, reply.fragments[2].to_s
80+
assert_match /^and under this./, reply.fragments[3].to_s
81+
assert_match /^> /, reply.fragments[4].to_s
82+
assert_match /^-/, reply.fragments[5].to_s
83+
end
84+
6685
def test_recognizes_date_string_above_quote
6786
reply = email :email_1_4
6887

test/emails/email_1_8.txt

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
On Tue, Apr 29, 2014 at 4:22 PM, Example Dev <[email protected]>wrote:
2+
3+
> okay. Well, here's some stuff I can write.
4+
>
5+
> And if I write a 2 second line you and maybe reply under this?
6+
>
7+
> Or if you didn't really feel like it, you could reply under this line.Or
8+
> if you didn't really feel like it, you could reply under this line. Or if
9+
> you didn't really feel like it, you could reply under this line. Or if you
10+
> didn't really feel like it, you could reply under this line.
11+
>
12+
13+
I will reply under this one
14+
15+
>
16+
> okay?
17+
>
18+
19+
and under this.
20+
21+
>
22+
> -- Tim
23+
>
24+
> On Tue, April 29, 2014 at 4:21 PM, Tim Haines <[email protected]> wrote:
25+
> > hi there
26+
> >
27+
> > After you reply to this I'm going to send you some inline responses.
28+
> >
29+
> > --
30+
> > Hey there, this is my signature
31+
>
32+
>
33+
>
34+
35+
36+
--
37+
Hey there, this is my signature

0 commit comments

Comments
 (0)