diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/mail_handler/mail_handler_spec.rb | 7 | ||||
-rw-r--r-- | spec/models/incoming_message_spec.rb | 5 |
2 files changed, 7 insertions, 5 deletions
diff --git a/spec/lib/mail_handler/mail_handler_spec.rb b/spec/lib/mail_handler/mail_handler_spec.rb index 6043bf5bc..dc147f32b 100644 --- a/spec/lib/mail_handler/mail_handler_spec.rb +++ b/spec/lib/mail_handler/mail_handler_spec.rb @@ -151,6 +151,13 @@ describe 'when deriving a name, email and formatted address from a message from [name, email, address].should == expected_result end + it 'should correctly render a name with quoted commas' do + should_render_from_address('"Clare College, Cambridge" <test@test.test>', + ['Clare College, Cambridge', + 'test@test.test', + '"Clare College, Cambridge" <test@test.test>']) + end + it 'should correctly reproduce a simple name and email that does not need quotes' do should_render_from_address('"FOI Person" <foiperson@localhost>', ['FOI Person', diff --git a/spec/models/incoming_message_spec.rb b/spec/models/incoming_message_spec.rb index 7afbacc9e..5478f6fc4 100644 --- a/spec/models/incoming_message_spec.rb +++ b/spec/models/incoming_message_spec.rb @@ -26,11 +26,6 @@ describe IncomingMessage, " when dealing with incoming mail" do @im.sent_at.should == @im.mail.date end - it "should be able to parse emails with quoted commas in" do - em = "\"Clare College, Cambridge\" <test@test.test>" - TMail::Address.parse(em) - end - it "should correctly fold various types of footer" do Dir.glob(File.join(Spec::Runner.configuration.fixture_path, "files", "email-folding-example-*.txt")).each do |file| message = File.read(file) |