We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 6daf769 + ebe7a03 commit 2bdba4aCopy full SHA for 2bdba4a
2 files changed
test/email_reply_parser_test.rb
@@ -63,6 +63,25 @@ def test_reads_bottom_post
63
assert_match /^_/, reply.fragments[5].to_s
64
end
65
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
85
def test_recognizes_date_string_above_quote
86
reply = email :email_1_4
87
test/emails/email_1_8.txt
@@ -0,0 +1,37 @@
1
+On Tue, Apr 29, 2014 at 4:22 PM, Example Dev <sugar@example.com>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 <tmhaines@example.com> 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