diff options
author | Louise Crow <louise.crow@gmail.com> | 2015-05-28 17:26:41 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2015-05-28 17:26:41 +0100 |
commit | 52bc4b39a34af00296637e996d199a5c3f1724bf (patch) | |
tree | 15f5a95871a44d23159a2b472424307fff2178a1 /spec/lib/mail_handler/backends | |
parent | 7a0e9d6a082721dd3d5c3f558b88b8052dbc9106 (diff) |
Address#to_s changes the input passed to it - dup before calling.
Otherwise UTF-8 encoded strings will be returned as ASCII-8BIT.
Diffstat (limited to 'spec/lib/mail_handler/backends')
-rw-r--r-- | spec/lib/mail_handler/backends/mail_backend_spec.rb | 17 |
1 files changed, 17 insertions, 0 deletions
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 <test@example.com>' + 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 |