mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fix tests on Mail 2.7.1
Up to `2.7.0`, encoding was chosen using `Mail::Encodings::TransferEncoding.negotiate`,
and base64 encoding was used.
In `2.7.1`, when `transfer_encoding` is not specified, the encoding
of the message is respected.
Related to: dead487e02
However, what chosen for transfer encoding is not essential in these tests.
To test more accurately, confirm that the decoded body instead.
This commit is contained in:
parent
4a51cbba58
commit
d2d6f6b7db
1 changed files with 4 additions and 4 deletions
|
@ -152,9 +152,9 @@ class BaseTest < ActiveSupport::TestCase
|
|||
assert_equal(2, email.parts.length)
|
||||
assert_equal("multipart/mixed", email.mime_type)
|
||||
assert_equal("text/html", email.parts[0].mime_type)
|
||||
assert_equal("Attachment with content", email.parts[0].body.encoded)
|
||||
assert_equal("Attachment with content", email.parts[0].decoded)
|
||||
assert_equal("application/pdf", email.parts[1].mime_type)
|
||||
assert_equal("VGhpcyBpcyB0ZXN0IEZpbGUgY29udGVudA==\r\n", email.parts[1].body.encoded)
|
||||
assert_equal("This is test File content", email.parts[1].decoded)
|
||||
end
|
||||
|
||||
test "adds the given :body as part" do
|
||||
|
@ -162,9 +162,9 @@ class BaseTest < ActiveSupport::TestCase
|
|||
assert_equal(2, email.parts.length)
|
||||
assert_equal("multipart/mixed", email.mime_type)
|
||||
assert_equal("text/plain", email.parts[0].mime_type)
|
||||
assert_equal("I'm the eggman", email.parts[0].body.encoded)
|
||||
assert_equal("I'm the eggman", email.parts[0].decoded)
|
||||
assert_equal("application/pdf", email.parts[1].mime_type)
|
||||
assert_equal("VGhpcyBpcyB0ZXN0IEZpbGUgY29udGVudA==\r\n", email.parts[1].body.encoded)
|
||||
assert_equal("This is test File content", email.parts[1].decoded)
|
||||
end
|
||||
|
||||
test "can embed an inline attachment" do
|
||||
|
|
Loading…
Reference in a new issue