Expected attachment encoding is binary

This commit is contained in:
Jeremy Kemper 2010-01-27 18:37:01 -08:00
parent e87748869a
commit 8c60acbea2
1 changed files with 4 additions and 2 deletions

View File

@ -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
end