From 8c60acbea22645278bb43a4fa575b298cea7671a Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Wed, 27 Jan 2010 18:37:01 -0800 Subject: Expected attachment encoding is binary --- actionmailer/test/base_test.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'actionmailer') diff --git a/actionmailer/test/base_test.rb b/actionmailer/test/base_test.rb index b7af86b622..9e1a4c22c6 100644 --- a/actionmailer/test/base_test.rb +++ b/actionmailer/test/base_test.rb @@ -167,7 +167,9 @@ class BaseTest < ActiveSupport::TestCase email = BaseMailer.attachment_with_hash assert_equal(1, email.attachments.length) assert_equal('invoice.jpg', email.attachments[0].filename) - assert_equal("\312\213\254\232)b", email.attachments['invoice.jpg'].decoded) + expected = "\312\213\254\232)b" + expected.force_encoding(Encoding::BINARY) if '1.9'.respond_to?(:force_encoding) + assert_equal expected, email.attachments['invoice.jpg'].decoded end test "sets mime type to multipart/mixed when attachment is included" do @@ -483,4 +485,4 @@ class BaseTest < ActiveSupport::TestCase hash[key] = value end end -end \ No newline at end of file +end -- cgit v1.2.3