diff options
author | Louise Crow <louise.crow@gmail.com> | 2011-03-28 15:16:10 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2011-03-28 15:16:10 +0100 |
commit | 6e36729b44673a0e77f03e100d094ebf020e8e32 (patch) | |
tree | be5c16d9592ce4e1c706b3b2691c5e2948be185e /spec/lib/tmail_extensions_spec.rb | |
parent | 1380232e20da4c0b9ce72efb43c1f4d1978ab5d7 (diff) |
Monkeypatching TMail parser to fix case where multiple addresses in the to: field of an incoming email have unquoted display parts - with this patch, each address is returned by the TMail to() function, without it only the last one is returned.
Diffstat (limited to 'spec/lib/tmail_extensions_spec.rb')
-rw-r--r-- | spec/lib/tmail_extensions_spec.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/lib/tmail_extensions_spec.rb b/spec/lib/tmail_extensions_spec.rb index d1a56f2e2..41e8c8f4e 100644 --- a/spec/lib/tmail_extensions_spec.rb +++ b/spec/lib/tmail_extensions_spec.rb @@ -22,5 +22,11 @@ describe "when using TMail" do incoming_message.get_body_for_html_display() end + it 'should parse multiple to addresses with unqoted display names' do + example_file = File.join(Spec::Runner.configuration.fixture_path, 'multiple-unquoted-display-names.email') + mail = TMail::Mail.parse(File.read(example_file)) + mail.to.should == ["request-66666-caa77777@whatdotheyknow.com", "foi@example.com"] + end + end |