aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/fixtures/multiple-unquoted-display-names.email27
-rw-r--r--spec/lib/tmail_extensions_spec.rb6
2 files changed, 33 insertions, 0 deletions
diff --git a/spec/fixtures/multiple-unquoted-display-names.email b/spec/fixtures/multiple-unquoted-display-names.email
new file mode 100644
index 000000000..e3a742c83
--- /dev/null
+++ b/spec/fixtures/multiple-unquoted-display-names.email
@@ -0,0 +1,27 @@
+From foi@example.com Mon Mar 21 09:58:48 2011
+Return-path: <foi@example.com>
+Envelope-to: foi@wildfire.ukcod.org.uk
+Delivery-date: Mon, 21 Mar 2011 09:58:48 +0000
+From: UAS Foi <foi@admin.ox.ac.uk>
+To: WDTK User <request-66666-caa77777@whatdotheyknow.com>, Another address
+ <foi@example.com>
+Date: Mon, 21 Mar 2011 09:58:30 +0000
+Subject: RE: Freedom of Information request - Participation in the IPCC
+ Assessment Process
+Thread-Topic: Freedom of Information request - Participation in the IPCC
+ Assessment Process
+Thread-Index: Acvlavo2wQr6iwN5SQy7Y/pEUUVYaQCQnamw
+Message-ID: <C351A7C3885B7141ACFE44C69D66A98B387D486FAB@EXMBX02.ad.oak.ox.ac.uk>
+References: <E1Q0Z7o-0007ie-FL@wildfire.ukcod.org.uk>
+In-Reply-To: <E1Q0Z7o-0007ie-FL@wildfire.ukcod.org.uk>
+Accept-Language: en-US, en-GB
+Content-Language: en-US
+X-MS-Has-Attach:
+X-MS-TNEF-Correlator:
+acceptlanguage: en-US, en-GB
+Content-Type: text/plain; charset="utf-8"
+Content-Transfer-Encoding: base64
+MIME-Version: 1.0
+
+stuff
+
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