-
Notifications
You must be signed in to change notification settings - Fork 13
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 #139 from dxw/add-simple-send-integration-tests
Add simple send integration tests
- Loading branch information
Showing
2 changed files
with
37 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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
require "test_helper" | ||
|
||
class NotifyMailerSendingTest < ActionDispatch::IntegrationTest | ||
# these tests are designed to run in our integration environment and make real | ||
# requests to Notify, the API key we use WILL NOT actually send any email. | ||
# | ||
# Once this spec runs, you will see these email in the Notify 'API Integrations' | ||
# log which requires an login for our integration test Notify account and only | ||
# remain for 7 days. | ||
# | ||
test "can send a template email" do | ||
result = NotifyMailer.with( | ||
to: "[email protected]" | ||
).template_email.deliver_now | ||
|
||
assert result.instance_of? Mail::Message | ||
end | ||
|
||
test "can send a template email with personalisation" do | ||
result = NotifyMailer.with( | ||
to: "[email protected]", | ||
name: "Test Name" | ||
).template_with_personalisation.deliver_now | ||
|
||
assert result.instance_of? Mail::Message | ||
end | ||
|
||
test "can send a view email" do | ||
result = NotifyMailer.with( | ||
to: "[email protected]", | ||
subject: "View email subject" | ||
).view_email.deliver_now | ||
|
||
assert result.instance_of? Mail::Message | ||
end | ||
end |