govuk_notify_rails 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +7 -0
  2. data/Rakefile +25 -0
  3. data/lib/govuk_notify_rails/delivery.rb +35 -0
  4. data/lib/govuk_notify_rails/mail_ext.rb +6 -0
  5. data/lib/govuk_notify_rails/mailer.rb +32 -0
  6. data/lib/govuk_notify_rails/version.rb +3 -0
  7. data/lib/govuk_notify_rails.rb +7 -0
  8. data/spec/dummy/README.rdoc +28 -0
  9. data/spec/dummy/Rakefile +6 -0
  10. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  11. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  12. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  13. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  14. data/spec/dummy/app/mailers/notify_mailer.rb +10 -0
  15. data/spec/dummy/app/views/layouts/application.html.erb +13 -0
  16. data/spec/dummy/bin/bundle +3 -0
  17. data/spec/dummy/bin/rails +4 -0
  18. data/spec/dummy/bin/rake +4 -0
  19. data/spec/dummy/bin/setup +29 -0
  20. data/spec/dummy/config/application.rb +27 -0
  21. data/spec/dummy/config/boot.rb +5 -0
  22. data/spec/dummy/config/environment.rb +5 -0
  23. data/spec/dummy/config/environments/development.rb +38 -0
  24. data/spec/dummy/config/environments/production.rb +76 -0
  25. data/spec/dummy/config/environments/test.rb +42 -0
  26. data/spec/dummy/config/initializers/assets.rb +11 -0
  27. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  28. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  29. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  30. data/spec/dummy/config/initializers/govuk_notify_rails.rb +3 -0
  31. data/spec/dummy/config/initializers/inflections.rb +16 -0
  32. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  33. data/spec/dummy/config/initializers/session_store.rb +3 -0
  34. data/spec/dummy/config/initializers/wrap_parameters.rb +9 -0
  35. data/spec/dummy/config/locales/en.yml +23 -0
  36. data/spec/dummy/config/routes.rb +56 -0
  37. data/spec/dummy/config/secrets.yml +22 -0
  38. data/spec/dummy/config.ru +4 -0
  39. data/spec/dummy/log/development.log +380 -0
  40. data/spec/dummy/log/test.log +6 -0
  41. data/spec/dummy/public/404.html +67 -0
  42. data/spec/dummy/public/422.html +67 -0
  43. data/spec/dummy/public/500.html +66 -0
  44. data/spec/dummy/public/favicon.ico +0 -0
  45. data/spec/govuk_notify_delivery/delivery_spec.rb +40 -0
  46. data/spec/mailers/notify_mailer_spec.rb +30 -0
  47. data/spec/spec_helper.rb +5 -0
  48. metadata +187 -0
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Rails.application
@@ -0,0 +1,380 @@
1
+
2
+ NotifyMailer#test_email: processed outbound mail in 2.9ms
3
+
4
+ NotifyMailer#test_email: processed outbound mail in 0.2ms
5
+
6
+ NotifyMailer#test_email: processed outbound mail in 0.2ms
7
+
8
+ NotifyMailer#test_email: processed outbound mail in 0.1ms
9
+
10
+ NotifyMailer#test_email: processed outbound mail in 0.1ms
11
+
12
+ NotifyMailer#test_email: processed outbound mail in 2.1ms
13
+
14
+ NotifyMailer#test_email: processed outbound mail in 0.2ms
15
+
16
+ NotifyMailer#test_email: processed outbound mail in 0.1ms
17
+
18
+ NotifyMailer#test_email: processed outbound mail in 0.2ms
19
+
20
+ NotifyMailer#test_email: processed outbound mail in 0.1ms
21
+
22
+ NotifyMailer#test_email: processed outbound mail in 110.7ms
23
+
24
+ NotifyMailer#test_email: processed outbound mail in 0.8ms
25
+
26
+ NotifyMailer#test_email: processed outbound mail in 0.7ms
27
+
28
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
29
+
30
+ NotifyMailer#test_email: processed outbound mail in 0.6ms
31
+
32
+ NotifyMailer#test_email: processed outbound mail in 81.2ms
33
+
34
+ NotifyMailer#test_email: processed outbound mail in 0.5ms
35
+
36
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
37
+
38
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
39
+
40
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
41
+
42
+ NotifyMailer#test_email: processed outbound mail in 83.7ms
43
+
44
+ NotifyMailer#test_email: processed outbound mail in 0.5ms
45
+
46
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
47
+
48
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
49
+
50
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
51
+
52
+ NotifyMailer#test_email: processed outbound mail in 87.6ms
53
+
54
+ NotifyMailer#test_email: processed outbound mail in 0.5ms
55
+
56
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
57
+
58
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
59
+
60
+ NotifyMailer#test_email: processed outbound mail in 0.5ms
61
+
62
+ NotifyMailer#test_email: processed outbound mail in 86.3ms
63
+
64
+ NotifyMailer#test_email: processed outbound mail in 0.5ms
65
+
66
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
67
+
68
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
69
+
70
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
71
+
72
+ NotifyMailer#test_email: processed outbound mail in 87.2ms
73
+
74
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
75
+
76
+ NotifyMailer#test_email: processed outbound mail in 0.6ms
77
+
78
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
79
+
80
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
81
+
82
+ NotifyMailer#test_email: processed outbound mail in 81.7ms
83
+
84
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
85
+
86
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
87
+
88
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
89
+
90
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
91
+
92
+ NotifyMailer#test_email: processed outbound mail in 82.1ms
93
+
94
+ NotifyMailer#test_email: processed outbound mail in 0.5ms
95
+
96
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
97
+
98
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
99
+
100
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
101
+
102
+ NotifyMailer#test_email: processed outbound mail in 82.9ms
103
+
104
+ NotifyMailer#test_email: processed outbound mail in 0.5ms
105
+
106
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
107
+
108
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
109
+
110
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
111
+
112
+ NotifyMailer#test_email: processed outbound mail in 83.0ms
113
+
114
+ NotifyMailer#test_email: processed outbound mail in 0.5ms
115
+
116
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
117
+
118
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
119
+
120
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
121
+
122
+ NotifyMailer#test_email: processed outbound mail in 86.0ms
123
+
124
+ NotifyMailer#test_email: processed outbound mail in 0.5ms
125
+
126
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
127
+
128
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
129
+
130
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
131
+
132
+ NotifyMailer#test_email: processed outbound mail in 84.4ms
133
+
134
+ NotifyMailer#test_email: processed outbound mail in 0.5ms
135
+
136
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
137
+
138
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
139
+
140
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
141
+
142
+ NotifyMailer#test_email: processed outbound mail in 85.3ms
143
+
144
+ NotifyMailer#test_email: processed outbound mail in 0.5ms
145
+
146
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
147
+
148
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
149
+
150
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
151
+
152
+ NotifyMailer#test_email: processed outbound mail in 82.6ms
153
+
154
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
155
+
156
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
157
+
158
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
159
+
160
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
161
+
162
+ NotifyMailer#test_email: processed outbound mail in 94.5ms
163
+
164
+ NotifyMailer#test_email: processed outbound mail in 0.5ms
165
+
166
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
167
+
168
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
169
+
170
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
171
+
172
+ NotifyMailer#test_email: processed outbound mail in 83.1ms
173
+
174
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
175
+
176
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
177
+
178
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
179
+
180
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
181
+
182
+ NotifyMailer#test_email: processed outbound mail in 82.4ms
183
+
184
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
185
+
186
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
187
+
188
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
189
+
190
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
191
+
192
+ NotifyMailer#test_email: processed outbound mail in 86.3ms
193
+
194
+ NotifyMailer#test_email: processed outbound mail in 0.6ms
195
+
196
+ NotifyMailer#test_email: processed outbound mail in 0.5ms
197
+
198
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
199
+
200
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
201
+
202
+ NotifyMailer#test_email: processed outbound mail in 114.2ms
203
+
204
+ NotifyMailer#test_email: processed outbound mail in 0.6ms
205
+
206
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
207
+
208
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
209
+
210
+ NotifyMailer#test_email: processed outbound mail in 0.5ms
211
+
212
+ NotifyMailer#test_email: processed outbound mail in 90.1ms
213
+
214
+ NotifyMailer#test_email: processed outbound mail in 0.5ms
215
+
216
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
217
+
218
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
219
+
220
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
221
+
222
+ NotifyMailer#test_email: processed outbound mail in 89.9ms
223
+
224
+ NotifyMailer#test_email: processed outbound mail in 0.5ms
225
+
226
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
227
+
228
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
229
+
230
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
231
+
232
+ NotifyMailer#test_email: processed outbound mail in 91.8ms
233
+
234
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
235
+
236
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
237
+
238
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
239
+
240
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
241
+
242
+ NotifyMailer#test_email: processed outbound mail in 90.6ms
243
+
244
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
245
+
246
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
247
+
248
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
249
+
250
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
251
+
252
+ NotifyMailer#test_email: processed outbound mail in 93.2ms
253
+
254
+ NotifyMailer#test_email: processed outbound mail in 0.5ms
255
+
256
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
257
+
258
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
259
+
260
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
261
+
262
+ NotifyMailer#test_email: processed outbound mail in 90.9ms
263
+
264
+ NotifyMailer#test_email: processed outbound mail in 0.5ms
265
+
266
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
267
+
268
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
269
+
270
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
271
+
272
+ NotifyMailer#test_email: processed outbound mail in 94.4ms
273
+
274
+ NotifyMailer#test_email: processed outbound mail in 0.9ms
275
+
276
+ NotifyMailer#test_email: processed outbound mail in 0.6ms
277
+
278
+ NotifyMailer#test_email: processed outbound mail in 0.8ms
279
+
280
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
281
+
282
+ NotifyMailer#test_email: processed outbound mail in 87.6ms
283
+
284
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
285
+
286
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
287
+
288
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
289
+
290
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
291
+
292
+ NotifyMailer#test_email: processed outbound mail in 85.0ms
293
+
294
+ NotifyMailer#test_email: processed outbound mail in 0.5ms
295
+
296
+ NotifyMailer#test_email: processed outbound mail in 4.5ms
297
+
298
+ NotifyMailer#test_email: processed outbound mail in 0.5ms
299
+
300
+ NotifyMailer#test_email: processed outbound mail in 0.5ms
301
+
302
+ NotifyMailer#test_email: processed outbound mail in 90.8ms
303
+
304
+ NotifyMailer#test_email: processed outbound mail in 0.5ms
305
+
306
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
307
+
308
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
309
+
310
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
311
+
312
+ NotifyMailer#test_email: processed outbound mail in 94.7ms
313
+
314
+ NotifyMailer#test_email: processed outbound mail in 0.5ms
315
+
316
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
317
+
318
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
319
+
320
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
321
+
322
+ NotifyMailer#test_email: processed outbound mail in 88.0ms
323
+
324
+ NotifyMailer#test_email: processed outbound mail in 0.7ms
325
+
326
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
327
+
328
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
329
+
330
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
331
+
332
+ NotifyMailer#test_email: processed outbound mail in 2.4ms
333
+
334
+ NotifyMailer#test_email: processed outbound mail in 0.2ms
335
+
336
+ NotifyMailer#test_email: processed outbound mail in 0.2ms
337
+
338
+ NotifyMailer#test_email: processed outbound mail in 0.2ms
339
+
340
+ NotifyMailer#test_email: processed outbound mail in 0.2ms
341
+
342
+ NotifyMailer#test_email: processed outbound mail in 88.6ms
343
+
344
+ NotifyMailer#test_email: processed outbound mail in 0.7ms
345
+
346
+ NotifyMailer#test_email: processed outbound mail in 0.5ms
347
+
348
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
349
+
350
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
351
+
352
+ NotifyMailer#test_email: processed outbound mail in 93.2ms
353
+
354
+ NotifyMailer#test_email: processed outbound mail in 0.5ms
355
+
356
+ NotifyMailer#test_email: processed outbound mail in 0.5ms
357
+
358
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
359
+
360
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
361
+
362
+ NotifyMailer#test_email: processed outbound mail in 103.1ms
363
+
364
+ NotifyMailer#test_email: processed outbound mail in 0.5ms
365
+
366
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
367
+
368
+ NotifyMailer#test_email: processed outbound mail in 0.7ms
369
+
370
+ NotifyMailer#test_email: processed outbound mail in 0.5ms
371
+
372
+ NotifyMailer#test_email: processed outbound mail in 87.5ms
373
+
374
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
375
+
376
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
377
+
378
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
379
+
380
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
@@ -0,0 +1,6 @@
1
+ -----------------------------------
2
+ GovukNotifyRailsTest: test_truth
3
+ -----------------------------------
4
+ -----------------------------------
5
+ GovukNotifyRailsTest: test_truth
6
+ -----------------------------------
@@ -0,0 +1,67 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body>
58
+ <!-- This file lives in public/404.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>The page you were looking for doesn't exist.</h1>
62
+ <p>You may have mistyped the address or the page may have moved.</p>
63
+ </div>
64
+ <p>If you are the application owner check the logs for more information.</p>
65
+ </div>
66
+ </body>
67
+ </html>
@@ -0,0 +1,67 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body>
58
+ <!-- This file lives in public/422.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>The change you wanted was rejected.</h1>
62
+ <p>Maybe you tried to change something you didn't have access to.</p>
63
+ </div>
64
+ <p>If you are the application owner check the logs for more information.</p>
65
+ </div>
66
+ </body>
67
+ </html>
@@ -0,0 +1,66 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body>
58
+ <!-- This file lives in public/500.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>We're sorry, but something went wrong.</h1>
62
+ </div>
63
+ <p>If you are the application owner check the logs for more information.</p>
64
+ </div>
65
+ </body>
66
+ </html>
File without changes
@@ -0,0 +1,40 @@
1
+ require 'spec_helper'
2
+ require 'govuk_notify_rails/delivery'
3
+
4
+ describe GovukNotifyRails::Delivery do
5
+ describe '#deliver!' do
6
+ let(:service_id) { 'service-123' }
7
+ let(:secret_key) { 'secret' }
8
+ let(:notify_client) { double('NotifyClient') }
9
+
10
+ let(:personalisation) { { name: 'John' } }
11
+
12
+ let(:message) do
13
+ instance_double(Mail::Message,
14
+ to: ['email@example.com'],
15
+ govuk_notify_template: 'template-123',
16
+ govuk_notify_personalisation: personalisation)
17
+ end
18
+
19
+ subject { described_class.new(service_id: service_id, secret_key: secret_key) }
20
+
21
+ before(:each) do
22
+ allow(notify_client).to receive(:new).with(service_id, secret_key).and_return(notify_client)
23
+ allow(subject).to receive(:notify_client).and_return(notify_client)
24
+ end
25
+
26
+ it 'should deliver the message payload' do
27
+ expect(notify_client).to receive(:send_email).with('{"to":"email@example.com","template":"template-123","personalisation":{"name":"John"}}')
28
+ subject.deliver!(message)
29
+ end
30
+
31
+ context 'no personalisation set' do
32
+ let(:personalisation) { nil }
33
+
34
+ it 'supports message without personalisation' do
35
+ expect(notify_client).to receive(:send_email).with('{"to":"email@example.com","template":"template-123"}')
36
+ subject.deliver!(message)
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,30 @@
1
+ require 'spec_helper'
2
+ require 'govuk_notify_rails/mailer'
3
+
4
+ RSpec.describe NotifyMailer, type: :mailer do
5
+ describe 'new_message_test_email' do
6
+ let(:template) { '9661d08a-486d-4c67-865e-ad976f17871d' }
7
+ let(:user) { double('User', name: 'Test Name', email: 'test@example.com') }
8
+ let(:mail) { described_class.test_email(user) }
9
+
10
+ it 'is a govuk_notify delivery' do
11
+ expect(mail.delivery_method).to be_a(GovukNotifyRails::Delivery)
12
+ end
13
+
14
+ it 'sets the recipient' do
15
+ expect(mail.to).to eq(['test@example.com'])
16
+ end
17
+
18
+ it 'sets the subject' do
19
+ expect(mail.body).to match("This is a GOV.UK Notify email with template #{template}")
20
+ end
21
+
22
+ it 'sets the template' do
23
+ expect(mail.govuk_notify_template).to eq(template)
24
+ end
25
+
26
+ it 'sets the personalisation' do
27
+ expect(mail.govuk_notify_personalisation.keys).to eq([:full_name])
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,5 @@
1
+ require File.expand_path('../dummy/config/environment.rb', __FILE__)
2
+
3
+ RSpec.configure do |config|
4
+ config.order = 'random'
5
+ end