From cae5b0aa950cf230a15eeca70a28c6f3c0a3db5c Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Thu, 28 May 2015 17:26:41 +0100 Subject: Address#to_s changes the input passed to it - dup before calling. Otherwise UTF-8 encoded strings will be returned as ASCII-8BIT. --- spec/lib/mail_handler/backends/mail_backend_spec.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'spec/lib/mail_handler/backends') diff --git a/spec/lib/mail_handler/backends/mail_backend_spec.rb b/spec/lib/mail_handler/backends/mail_backend_spec.rb index 588033faf..eb1d4b167 100644 --- a/spec/lib/mail_handler/backends/mail_backend_spec.rb +++ b/spec/lib/mail_handler/backends/mail_backend_spec.rb @@ -142,4 +142,21 @@ DOC end + describe :address_from_name_and_email do + + it 'returns an address string' do + expected = 'Test User ' + address_from_name_and_email('Test User', 'test@example.com').should == expected + end + + it 'does not change the name passed to it' do + original = "brønn" + name = original.dup + address_from_name_and_email(name, 'test@example.com') + name.should == original + end + + end + + end -- cgit v1.2.3