aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/test/base_test.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2010-01-27 18:37:01 -0800
committerJeremy Kemper <jeremy@bitsweat.net>2010-01-27 18:37:17 -0800
commit8c60acbea22645278bb43a4fa575b298cea7671a (patch)
tree92d2ec3115cc288b1148b857cc2c63961edbcf5e /actionmailer/test/base_test.rb
parente87748869af238fe6bcb78e8d9a8d2bbc3734039 (diff)
downloadrails-8c60acbea22645278bb43a4fa575b298cea7671a.tar.gz
rails-8c60acbea22645278bb43a4fa575b298cea7671a.tar.bz2
rails-8c60acbea22645278bb43a4fa575b298cea7671a.zip
Expected attachment encoding is binary
Diffstat (limited to 'actionmailer/test/base_test.rb')
-rw-r--r--actionmailer/test/base_test.rb6
1 files changed, 4 insertions, 2 deletions
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