govuk_notify_rails 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f18695b6e10853e1315086f370905884654a58a1
4
- data.tar.gz: 7b966ffaec4bb686445c5e4a04805ab56a42baea
3
+ metadata.gz: 8c8cfae3d9c9ea680d58a9d24aafe725365a8542
4
+ data.tar.gz: c9b21033bbbd27f9ce00b22aaee945cab02d3ea6
5
5
  SHA512:
6
- metadata.gz: bdf44697db9f0e8d68a27829fe9f049b9f0a6b6d286fd73382945677a03355c6bfcb036d8d91ecbfc98d586847706c49c289a39019f9c2596e6c887dcee9db51
7
- data.tar.gz: 354f76b28d13dc315f7a6c50c82805fa314779e9b42b5586ec9c885991e2289e48e26899fd1754147c7e748fcce90ca2ef666d964bb1b53b6ea3934f5bb7c182
6
+ metadata.gz: efb994f4e8a918b16a8ec04f2015330d704bbf8a98f946a86158cb768fc462d577a925cd84a60644520a72601a912399a259d1167f5cb35d24a3f3cdca4e978b
7
+ data.tar.gz: befa2a1f409c790dc98ee3c18a3befec69d60b05d901e7bdad0ead4f51d790075ceb1f406e7971e14f90cbfcfec772540fbff639a59e1a0135329e190acbea02
@@ -7,7 +7,10 @@ module GovukNotifyRails
7
7
  end
8
8
 
9
9
  def deliver!(message)
10
- notify_client.send_email(payload_for(message))
10
+ response = notify_client.send_email(
11
+ payload_for(message)
12
+ )
13
+ message.govuk_notify_response = response
11
14
  end
12
15
 
13
16
  private
@@ -3,5 +3,6 @@ module Mail
3
3
  attr_accessor :govuk_notify_template
4
4
  attr_accessor :govuk_notify_reference
5
5
  attr_accessor :govuk_notify_personalisation
6
+ attr_accessor :govuk_notify_response
6
7
  end
7
8
  end
@@ -1,3 +1,3 @@
1
1
  module GovukNotifyRails
2
- VERSION = '2.0.0'.freeze
2
+ VERSION = '2.1.0'.freeze
3
3
  end
@@ -29,8 +29,6 @@ Rails.application.configure do
29
29
  # Don't care if the mailer can't send.
30
30
  config.action_mailer.raise_delivery_errors = false
31
31
 
32
- config.action_mailer.perform_caching = false
33
-
34
32
  # Print deprecation notices to the Rails logger.
35
33
  config.active_support.deprecation = :log
36
34
 
@@ -47,8 +45,4 @@ Rails.application.configure do
47
45
 
48
46
  # Raises error for missing translations
49
47
  # config.action_view.raise_on_missing_translations = true
50
-
51
- # Use an evented file watcher to asynchronously detect changes in source code,
52
- # routes, locales, etc. This feature depends on the listen gem.
53
- config.file_watcher = ActiveSupport::EventedFileUpdateChecker
54
48
  end
@@ -55,7 +55,6 @@ Rails.application.configure do
55
55
  # Use a real queuing backend for Active Job (and separate queues per environment)
56
56
  # config.active_job.queue_adapter = :resque
57
57
  # config.active_job.queue_name_prefix = "dummy_#{Rails.env}"
58
- config.action_mailer.perform_caching = false
59
58
 
60
59
  # Ignore bad email addresses and do not raise email delivery errors.
61
60
  # Set this to true and configure the email server for immediate delivery to raise delivery errors.
@@ -27,7 +27,6 @@ Rails.application.configure do
27
27
 
28
28
  # Disable request forgery protection in test environment.
29
29
  config.action_controller.allow_forgery_protection = false
30
- config.action_mailer.perform_caching = false
31
30
 
32
31
  # Tell Action Mailer not to deliver emails to the real world.
33
32
  # The :test delivery method accumulates sent emails in the
@@ -10,15 +10,8 @@ Rails.application.config.action_controller.per_form_csrf_tokens = true
10
10
  # Enable origin-checking CSRF mitigation. Previous versions had false.
11
11
  Rails.application.config.action_controller.forgery_protection_origin_check = true
12
12
 
13
- # Make Ruby 2.4 preserve the timezone of the receiver when calling `to_time`.
14
- # Previous versions had false.
15
- ActiveSupport.to_time_preserves_timezone = true
16
-
17
13
  # Require `belongs_to` associations by default. Previous versions had false.
18
14
  Rails.application.config.active_record.belongs_to_required_by_default = true
19
15
 
20
- # Do not halt callback chains when a callback returns false. Previous versions had true.
21
- ActiveSupport.halt_callback_chains_on_return_false = false
22
-
23
16
  # Configure SSL options to enable HSTS with subdomains. Previous versions had false.
24
17
  Rails.application.config.ssl_options = { hsts: { subdomains: true } }
@@ -37,3 +37,123 @@ NotifyMailer#test_email: processed outbound mail in 0.5ms
37
37
  NotifyMailer#test_email: processed outbound mail in 0.5ms
38
38
  NotifyMailer#test_email: processed outbound mail in 0.4ms
39
39
  NotifyMailer#test_email: processed outbound mail in 0.4ms
40
+ NotifyMailer#test_email: processed outbound mail in 116.8ms
41
+ NotifyMailer#test_email: processed outbound mail in 0.6ms
42
+ NotifyMailer#test_email: processed outbound mail in 0.6ms
43
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
44
+ NotifyMailer#test_email: processed outbound mail in 0.6ms
45
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
46
+ NotifyMailer#test_email: processed outbound mail in 205.7ms
47
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
48
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
49
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
50
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
51
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
52
+
53
+ NotifyMailer#test_email: processed outbound mail in 149.8ms
54
+
55
+ NotifyMailer#test_email: processed outbound mail in 0.5ms
56
+
57
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
58
+
59
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
60
+
61
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
62
+
63
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
64
+
65
+ NotifyMailer#test_email: processed outbound mail in 5.9ms
66
+
67
+ NotifyMailer#test_email: processed outbound mail in 1.7ms
68
+
69
+ NotifyMailer#test_email: processed outbound mail in 1.6ms
70
+
71
+ NotifyMailer#test_email: processed outbound mail in 1.6ms
72
+
73
+ NotifyMailer#test_email: processed outbound mail in 1.7ms
74
+
75
+ NotifyMailer#test_email: processed outbound mail in 1.6ms
76
+ NotifyMailer#test_email: processed outbound mail in 174.3ms
77
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
78
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
79
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
80
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
81
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
82
+ NotifyMailer#test_email: processed outbound mail in 188.2ms
83
+ NotifyMailer#test_email: processed outbound mail in 0.6ms
84
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
85
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
86
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
87
+ NotifyMailer#test_email: processed outbound mail in 0.5ms
88
+ NotifyMailer#test_email: processed outbound mail in 176.9ms
89
+ NotifyMailer#test_email: processed outbound mail in 0.5ms
90
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
91
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
92
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
93
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
94
+ NotifyMailer#test_email: processed outbound mail in 173.6ms
95
+ NotifyMailer#test_email: processed outbound mail in 0.5ms
96
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
97
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
98
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
99
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
100
+ NotifyMailer#test_email: processed outbound mail in 3.7ms
101
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
102
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
103
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
104
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
105
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
106
+ NotifyMailer#test_email: processed outbound mail in 181.2ms
107
+ NotifyMailer#test_email: processed outbound mail in 0.7ms
108
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
109
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
110
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
111
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
112
+ NotifyMailer#test_email: processed outbound mail in 191.2ms
113
+ NotifyMailer#test_email: processed outbound mail in 0.5ms
114
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
115
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
116
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
117
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
118
+ NotifyMailer#test_email: processed outbound mail in 179.9ms
119
+ NotifyMailer#test_email: processed outbound mail in 0.5ms
120
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
121
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
122
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
123
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
124
+ NotifyMailer#test_email: processed outbound mail in 176.7ms
125
+ NotifyMailer#test_email: processed outbound mail in 0.5ms
126
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
127
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
128
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
129
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
130
+ NotifyMailer#test_email: processed outbound mail in 180.3ms
131
+ NotifyMailer#test_email: processed outbound mail in 0.5ms
132
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
133
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
134
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
135
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
136
+ NotifyMailer#test_email: processed outbound mail in 186.9ms
137
+ NotifyMailer#test_email: processed outbound mail in 0.5ms
138
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
139
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
140
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
141
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
142
+ NotifyMailer#test_email: processed outbound mail in 180.3ms
143
+ NotifyMailer#test_email: processed outbound mail in 0.5ms
144
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
145
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
146
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
147
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
148
+ NotifyMailer#test_email: processed outbound mail in 193.3ms
149
+ NotifyMailer#test_email: processed outbound mail in 0.5ms
150
+ NotifyMailer#test_email: processed outbound mail in 0.6ms
151
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
152
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
153
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
154
+ NotifyMailer#test_email: processed outbound mail in 178.5ms
155
+ NotifyMailer#test_email: processed outbound mail in 0.5ms
156
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
157
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
158
+ NotifyMailer#test_email: processed outbound mail in 0.4ms
159
+ NotifyMailer#test_email: processed outbound mail in 0.3ms
@@ -24,6 +24,7 @@ describe GovukNotifyRails::Delivery do
24
24
  before(:each) do
25
25
  allow(notify_client).to receive(:new).with(api_key).and_return(notify_client)
26
26
  allow(subject).to receive(:notify_client).and_return(notify_client)
27
+ allow(message).to receive(:govuk_notify_response=)
27
28
  end
28
29
 
29
30
  it 'should deliver the message payload' do
@@ -33,6 +34,21 @@ describe GovukNotifyRails::Delivery do
33
34
  subject.deliver!(message)
34
35
  end
35
36
 
37
+ context 'client response' do
38
+ before do
39
+ allow(notify_client).to receive(:send_email).and_return('response')
40
+ end
41
+
42
+ it 'returns the client response' do
43
+ expect(subject.deliver!(message)).to eq('response')
44
+ end
45
+
46
+ it 'assigns the client response for later inspection' do
47
+ subject.deliver!(message)
48
+ expect(message).to have_received(:govuk_notify_response=).with('response')
49
+ end
50
+ end
51
+
36
52
  context 'no personalisation set' do
37
53
  let(:personalisation) { nil }
38
54
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_notify_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jesus Laiz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-24 00:00:00.000000000 Z
11
+ date: 2018-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 2.0.0
33
+ version: 2.9.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 2.0.0
40
+ version: 2.9.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement