-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a test case for 8bit attachment without GPG
This is the opposite behaviour to the test case added in the previous commit (the attachment goes in unmodified).
- Loading branch information
Showing
1 changed file
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,9 +36,34 @@ def teardown | |
$config = nil | ||
end | ||
|
||
def test_attachment_content_transfer_encoding_signed | ||
def test_attachment_content_transfer_encoding | ||
## RMail::Message#make_attachment will choose | ||
## Content-Transfer-Encoding: 8bit for a CSV file. | ||
## If we're not GPG signing or encrypting then the attachment will be sent | ||
## as is. Note this assumes the SMTP servers in the delivery path all | ||
## support the 8BITMIME extension. | ||
attachment_content = "löl,\ntest,\n" | ||
attachment_filename = File.join @path, "dummy.csv" | ||
File.write attachment_filename, attachment_content | ||
|
||
opts = { | ||
:header => { | ||
"From" => "[email protected]", | ||
"To" => "[email protected]", | ||
}, | ||
:attachments => { | ||
"dummy.csv" => RMail::Message.make_file_attachment(attachment_filename), | ||
}, | ||
} | ||
mode = Redwood::EditMessageMode.new opts | ||
|
||
msg = mode.send :build_message, Time.now | ||
attachment = msg.part(1) | ||
assert_equal attachment_content, attachment.body | ||
assert_equal "8bit", attachment.header["Content-Transfer-Encoding"] | ||
end | ||
|
||
def test_attachment_content_transfer_encoding_signed | ||
attachment_filename = File.join @path, "dummy.csv" | ||
## Include some high bytes in the attachment contents in order to | ||
## exercise quote-printable transfer encoding. | ||
|