diff options
author | Louise Crow <louise.crow@gmail.com> | 2015-05-28 17:26:41 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2015-06-04 15:51:56 +0100 |
commit | cae5b0aa950cf230a15eeca70a28c6f3c0a3db5c (patch) | |
tree | 1fe9730188a48433d1e874b53e8ae3efde2e6148 /spec | |
parent | 6e621bcfde5609a692f964c2e16c0c74796f2d3b (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')
-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 |