-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from foca/custom-headers
Allow configuring the email envelope
- Loading branch information
Showing
2 changed files
with
10 additions
and
0 deletions.
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
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 |
---|---|---|
|
@@ -186,6 +186,15 @@ def SMTP.new(host, port) | |
assert $smtp[:finish] | ||
end | ||
|
||
test "adding custom headers" do |m| | ||
m.deliver(to: "[email protected]", from: "[email protected]", | ||
subject: "Happy new year!", text: "TEXT") do |mail| | ||
mail.add_header("X-MC-SendAt", "2016-01-01 00:00:00") | ||
end | ||
|
||
assert $smtp[:blob].include?("X-MC-SendAt: 2016-01-01 00:00:00") | ||
end | ||
|
||
test "calls #finish even when it fails during send_message" do |m| | ||
class FakeSMTP | ||
def send_message(*args) | ||
|