gds-api-adapters 52.5.0 → 52.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aec33b725938e09035043960dd0f4571f712bc71930eb93bd2684888730529af
4
- data.tar.gz: ac1f9bd79d271352d0896f6997bdf5a6609afc33016d422bf0b66993bf31f566
3
+ metadata.gz: b390045df77872eff71b5a5e3c751a9091613bcedf606274b1918656a01457c0
4
+ data.tar.gz: 7f9f5c6a0e2da810ffb87a5ad6ffc8052e324686e571ec9bf8ee3a07e565b363
5
5
  SHA512:
6
- metadata.gz: 62ffe96af3f95e88ba37096f5eebef3ccaca181ab86e87cae1319f1eed8eedeee4ee4b4cf7eb65e8df201cc54980d9106a378207bbece98e55bce83503a3e205
7
- data.tar.gz: e5acd2473f6c23bdf629f113bdd2cbfa6ef14e3cdd68bab07ef9bfa1895cebedcc3a7b6c79642add884c31cc730f85126a57baf2deebf926305bce45301fa472
6
+ metadata.gz: aff59a9c8aa7d016121b62005e4728190ed06c6b4bc3ed14a8e35d854178b5102265f351a4cec454ddf2c68aa8c290099bda43950596fe31801ac6788708d394
7
+ data.tar.gz: 52ba48122256caae1a34e1e0e6c305bb798a700b24788a271e2d1a9c8dfdeae1ec85c3122ef0d265cd4416f481b3b0de73e36472d845f9a5cd56373cf88f4254
@@ -23,7 +23,7 @@ module GdsApi
23
23
  stub_request(:patch, "#{EMAIL_ALERT_API_ENDPOINT}/subscriptions/#{subscription_id}")
24
24
  .to_return(
25
25
  status: 200,
26
- body: get_subscription_response(subscription_id, frequency).to_json,
26
+ body: get_subscription_response(subscription_id, frequency: frequency).to_json,
27
27
  )
28
28
  end
29
29
 
@@ -45,11 +45,25 @@ module GdsApi
45
45
  .to_return(status: 404)
46
46
  end
47
47
 
48
- def email_alert_api_has_subscription(id, frequency, title: "Some title")
48
+ def email_alert_api_has_subscription(
49
+ id,
50
+ frequency,
51
+ title: "Some title",
52
+ subscriber_id: 1,
53
+ subscriber_list_id: 1000,
54
+ ended: false
55
+ )
49
56
  stub_request(:get, "#{EMAIL_ALERT_API_ENDPOINT}/subscriptions/#{id}")
50
57
  .to_return(
51
58
  status: 200,
52
- body: get_subscription_response(id, frequency, title).to_json,
59
+ body: get_subscription_response(
60
+ id,
61
+ frequency: frequency,
62
+ title: title,
63
+ subscriber_id: subscriber_id,
64
+ subscriber_list_id: subscriber_list_id,
65
+ ended: ended,
66
+ ).to_json,
53
67
  )
54
68
  end
55
69
 
@@ -211,15 +225,27 @@ module GdsApi
211
225
  }
212
226
  end
213
227
 
214
- def get_subscription_response(id, frequency, title = "Some title")
228
+ def get_subscription_response(
229
+ id,
230
+ frequency: "daily",
231
+ title: "Some title",
232
+ subscriber_id: 1,
233
+ subscriber_list_id: 1000,
234
+ ended: false
235
+ )
215
236
  {
216
237
  "subscription" => {
217
- "subscriber_id" => 1,
218
- "subscriber_list_id" => 1000,
219
- "frequency" => frequency,
220
238
  "id" => id,
239
+ "frequency" => frequency,
240
+ "source" => "user_signed_up",
241
+ "ended_at" => ended ? Time.now.rfc3339 : nil,
242
+ "ended_reason" => ended ? "unsubscribed" : nil,
243
+ "subscriber" => {
244
+ "id" => subscriber_id,
245
+ "address" => "test@example.com",
246
+ },
221
247
  "subscriber_list" => {
222
- "id" => 1000,
248
+ "id" => subscriber_list_id,
223
249
  "slug" => "some-thing",
224
250
  "title" => title,
225
251
  }
@@ -1,3 +1,3 @@
1
1
  module GdsApi
2
- VERSION = '52.5.0'.freeze
2
+ VERSION = '52.5.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gds-api-adapters
3
3
  version: !ruby/object:Gem::Version
4
- version: 52.5.0
4
+ version: 52.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-28 00:00:00.000000000 Z
11
+ date: 2018-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: plek