-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: options included in the headers
The call to `except` here should not be an array as there is no array of these symbol to exclude from the hash. This issue was kindly identified by @inulty-dfe in #162.
- Loading branch information
Showing
3 changed files
with
39 additions
and
2 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
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 |
---|---|---|
|
@@ -115,6 +115,23 @@ | |
ArgumentError, "You must specify a subject" | ||
) | ||
end | ||
|
||
it "does not include the personalisation, reply_to_id or reference options in the headers" do | ||
message_params = { | ||
template_id: "template-id", | ||
to: "[email protected]", | ||
subject: "Test subject", | ||
personalisation: "test-personalisation", | ||
reply_to_id: "[email protected]", | ||
reference: "test-reference" | ||
} | ||
|
||
message = TestMailer.with(message_params).test_view_mail | ||
|
||
expect(message.header[:personalisation]).to be_nil | ||
expect(message.header[:reply_to_id]).to be_nil | ||
expect(message.header[:reference]).to be_nil | ||
end | ||
end | ||
|
||
describe "#template_email" do | ||
|
@@ -202,6 +219,23 @@ | |
|
||
expect(message.reference).to eql("test-reference") | ||
end | ||
|
||
it "does not include the personalisation, reply_to_id or reference options in the headers" do | ||
message_params = { | ||
template_id: "template-id", | ||
to: "[email protected]", | ||
subject: "Test subject", | ||
personalisation: "test-personalisation", | ||
reply_to_id: "[email protected]", | ||
reference: "test-reference" | ||
} | ||
|
||
message = TestMailer.with(message_params).test_template_mail | ||
|
||
expect(message.header[:personalisation]).to be_nil | ||
expect(message.header[:reply_to_id]).to be_nil | ||
expect(message.header[:reference]).to be_nil | ||
end | ||
end | ||
|
||
describe "#blank_allowed" do | ||
|