File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ RUN bundle install
54
54
# Copy over intergration test files
55
55
COPY test/mailers/ test/mailers/
56
56
COPY test/system/ test/system/
57
+ COPY test/integration test/integration
57
58
COPY test/application_system_test_case.rb /test/application_system_test_case.rb
58
59
COPY test/app/mailers/ app/mailers/
59
60
COPY test/app/views/ app/views/
Original file line number Diff line number Diff line change
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
You can’t perform that action at this time.
0 commit comments