Skip to content

Commit b5b17fe

Browse files
authored
Merge pull request #139 from dxw/add-simple-send-integration-tests
Add simple send integration tests
2 parents 0d8e020 + 91f0143 commit b5b17fe

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ RUN bundle install
5454
# Copy over intergration test files
5555
COPY test/mailers/ test/mailers/
5656
COPY test/system/ test/system/
57+
COPY test/integration test/integration
5758
COPY test/application_system_test_case.rb /test/application_system_test_case.rb
5859
COPY test/app/mailers/ app/mailers/
5960
COPY test/app/views/ app/views/
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
require "test_helper"
2+
3+
class NotifyMailerSendingTest < ActionDispatch::IntegrationTest
4+
# these tests are designed to run in our integration environment and make real
5+
# requests to Notify, the API key we use WILL NOT actually send any email.
6+
#
7+
# Once this spec runs, you will see these email in the Notify 'API Integrations'
8+
# log which requires an login for our integration test Notify account and only
9+
# remain for 7 days.
10+
#
11+
test "can send a template email" do
12+
result = NotifyMailer.with(
13+
to: "template.email@notifications.service.gov.uk"
14+
).template_email.deliver_now
15+
16+
assert result.instance_of? Mail::Message
17+
end
18+
19+
test "can send a template email with personalisation" do
20+
result = NotifyMailer.with(
21+
to: "template.email@notifications.service.gov.uk",
22+
name: "Test Name"
23+
).template_with_personalisation.deliver_now
24+
25+
assert result.instance_of? Mail::Message
26+
end
27+
28+
test "can send a view email" do
29+
result = NotifyMailer.with(
30+
to: "view.email@notifications.service.gov.uk",
31+
subject: "View email subject"
32+
).view_email.deliver_now
33+
34+
assert result.instance_of? Mail::Message
35+
end
36+
end

0 commit comments

Comments
 (0)