|
157 | 157 | expect(body_from_email(text: body)).to eq 'Hello.' |
158 | 158 | end |
159 | 159 |
|
| 160 | + it 'handles french format: "Le [date], [soandso] <[email protected]> a écrit :"' do |
| 161 | + body = <<-EOF.strip_heredoc |
| 162 | + Hello. |
| 163 | +
|
| 164 | + Le 11 mars 2016, at 18:00, Tristan <[email protected]> a écrit : |
| 165 | + > Check out this report. |
| 166 | + > |
| 167 | + > It's pretty cool. |
| 168 | + > |
| 169 | + > Thanks, Tristan |
| 170 | + > |
| 171 | + EOF |
| 172 | + |
| 173 | + expect(body_from_email(text: body)).to eq 'Hello.' |
| 174 | + end |
| 175 | + |
| 176 | + it 'handles LONG french format: "Le [date], [soandso] <[email protected]> a écrit :"' do |
| 177 | + body = <<-EOF.strip_heredoc |
| 178 | + Hello. |
| 179 | +
|
| 180 | + Le 11 mars 2016, at 18:00, Tristan With A Really Really Long Name < |
| 181 | + tristanhasasuperlongemailthatforcesanewline@candidates.welcomekit.co> a |
| 182 | + écrit : |
| 183 | + > Check out this report. |
| 184 | + > |
| 185 | + > It's pretty cool. |
| 186 | + > |
| 187 | + > Thanks, Tristan |
| 188 | + > |
| 189 | + EOF |
| 190 | + |
| 191 | + expect(body_from_email(text: body)).to eq 'Hello.' |
| 192 | + end |
| 193 | + |
| 194 | + it 'handles spanish format: "El [date], [soandso] <[email protected]> escribió:"' do |
| 195 | + body = <<-EOF.strip_heredoc |
| 196 | + Hello. |
| 197 | +
|
| 198 | + El 11/03/2016 11:34, Pedro Pérez <[email protected]> escribió: |
| 199 | + > Check out this report. |
| 200 | + > |
| 201 | + > It's pretty cool. |
| 202 | + > |
| 203 | + > Thanks, Pedro |
| 204 | + > |
| 205 | + EOF |
| 206 | + |
| 207 | + expect(body_from_email(text: body)).to eq 'Hello.' |
| 208 | + end |
| 209 | + |
| 210 | + it 'handles LONG spanish format: "El [date], [soandso] <[email protected]> escribió:"' do |
| 211 | + body = <<-EOF.strip_heredoc |
| 212 | + Hello. |
| 213 | +
|
| 214 | + El 11/03/2016 11:34, Pedro Pérez < |
| 215 | + |
| 216 | + > Check out this report. |
| 217 | + > |
| 218 | + > It's pretty cool. |
| 219 | + > |
| 220 | + > Thanks, Pedro |
| 221 | + > |
| 222 | + EOF |
| 223 | + |
| 224 | + expect(body_from_email(text: body)).to eq 'Hello.' |
| 225 | + end |
| 226 | + |
160 | 227 | it 'handles "From: [email protected]" format' do |
161 | 228 | body = <<-EOF |
162 | 229 | Hello. |
|
0 commit comments