Permalink
Browse files

Expected attachment encoding is binary

  • Loading branch information...
1 parent e877488 commit 8c60acbea22645278bb43a4fa575b298cea7671a @jeremy jeremy committed Jan 28, 2010
Showing with 4 additions and 2 deletions.
  1. +4 −2 actionmailer/test/base_test.rb
@@ -167,7 +167,9 @@ def custom_block(include_html=false)
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 @@ def with_default(klass, new_values)
hash[key] = value
end
end
-end
+end

0 comments on commit 8c60acb

Please sign in to comment.