gds-api-adapters 67.2.1 → 68.0.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
  SHA256:
3
- metadata.gz: 4f4e9476c570389a75e06b65715133d92402d748e4b15fd0b30782a7eca32847
4
- data.tar.gz: e1e5d3284178b1f22f29dc63d1cf0fde389c82224f56146d6db40304fa211ca0
3
+ metadata.gz: d65f642d5b2a1a78b79cada08224db09ac522eed4c6f2a096916ae076f0c6328
4
+ data.tar.gz: 314f7be8b8aea542036199fae93de9b9c7c7f3e18b1d5234b0872c26c3ae35f8
5
5
  SHA512:
6
- metadata.gz: 392d0964f21b56895aab0fb54a0a566b4c7186f69dbbefa85a31001a255d6cd3a296e982c72df36cc538f93c7beda156430945b86c626a66a50aa35cef29f7b3
7
- data.tar.gz: 9a41486139d341afcd11559b40407c6bf58836e4aad2f15dce2380297da40e9edb2ef29176410708d067ed692672c54de5cee1b4e455176d4b455682398f30eb
6
+ metadata.gz: 8269a099df5843b9bc45dabad688a59461b9fcb7b50c876b69981ee8fc919db8e318421a9ac478dacff2f4bb0a73e0675589686bfaf878e024f06a17117d351d
7
+ data.tar.gz: 426d5db6c08678e134ecbd84b315f2cb22df30a5fcbcb3e1de89ff980d5edebcd75b229e6cb4ef95c4a7f86c78f3909452246376a7fb5750ec63fcaf1d4d3831
@@ -24,7 +24,6 @@ class GdsApi::EmailAlertApi < GdsApi::Base
24
24
  document_type = attributes["document_type"]
25
25
  email_document_supertype = attributes["email_document_supertype"]
26
26
  government_document_supertype = attributes["government_document_supertype"]
27
- gov_delivery_id = attributes["gov_delivery_id"]
28
27
  combine_mode = attributes["combine_mode"]
29
28
 
30
29
  if tags && links
@@ -38,7 +37,6 @@ class GdsApi::EmailAlertApi < GdsApi::Base
38
37
  params[:document_type] = document_type if document_type
39
38
  params[:email_document_supertype] = email_document_supertype if email_document_supertype
40
39
  params[:government_document_supertype] = government_document_supertype if government_document_supertype
41
- params[:gov_delivery_id] = gov_delivery_id if gov_delivery_id
42
40
  params[:combine_mode] = combine_mode if combine_mode
43
41
 
44
42
  query_string = nested_query_string(params)
@@ -131,7 +129,6 @@ class GdsApi::EmailAlertApi < GdsApi::Base
131
129
  # @return [Hash] subscriber_list: {
132
130
  # id
133
131
  # title
134
- # gov_delivery_id
135
132
  # created_at
136
133
  # updated_at
137
134
  # document_type
@@ -218,27 +218,31 @@ module GdsApi
218
218
  .to_return(status: 404)
219
219
  end
220
220
 
221
- def stub_email_alert_api_creates_a_subscription(subscriber_list_id, address, frequency, returned_subscription_id, skip_confirmation_email: false)
222
- stub_request(:post, "#{EMAIL_ALERT_API_ENDPOINT}/subscriptions")
223
- .with(
224
- body: {
225
- subscriber_list_id: subscriber_list_id,
226
- address: address,
227
- frequency: frequency,
228
- skip_confirmation_email: skip_confirmation_email,
229
- }.to_json,
230
- ).to_return(status: 201, body: { id: returned_subscription_id }.to_json)
231
- end
221
+ def stub_email_alert_api_creates_a_subscription(
222
+ subscriber_list_id: nil,
223
+ address: nil,
224
+ frequency: nil,
225
+ returned_subscription_id: nil,
226
+ skip_confirmation_email: false,
227
+ subscriber_id: nil
228
+ )
229
+ response = get_subscription_response(
230
+ returned_subscription_id,
231
+ frequency: frequency,
232
+ subscriber_list_id: subscriber_list_id,
233
+ subscriber_id: subscriber_id,
234
+ )
235
+
236
+ request_params = {
237
+ subscriber_list_id: subscriber_list_id,
238
+ address: address,
239
+ frequency: frequency,
240
+ skip_confirmation_email: skip_confirmation_email,
241
+ }
232
242
 
233
- def stub_email_alert_api_creates_an_existing_subscription(subscriber_list_id, address, frequency, returned_subscription_id)
234
243
  stub_request(:post, "#{EMAIL_ALERT_API_ENDPOINT}/subscriptions")
235
- .with(
236
- body: hash_including(
237
- subscriber_list_id: subscriber_list_id,
238
- address: address,
239
- frequency: frequency,
240
- ),
241
- ).to_return(status: 200, body: { id: returned_subscription_id }.to_json)
244
+ .with(body: hash_including(request_params.compact))
245
+ .to_return(status: 200, body: response.to_json)
242
246
  end
243
247
 
244
248
  def stub_email_alert_api_refuses_to_create_subscription(subscriber_list_id, address, frequency)
@@ -394,7 +398,6 @@ module GdsApi
394
398
  document_type = attributes["document_type"]
395
399
  email_document_supertype = attributes["email_document_supertype"]
396
400
  government_document_supertype = attributes["government_document_supertype"]
397
- gov_delivery_id = attributes["gov_delivery_id"]
398
401
  content_purpose_supergroup = attributes["content_purpose_supergroup"]
399
402
  combine_mode = attributes["combine_mode"]
400
403
 
@@ -404,7 +407,6 @@ module GdsApi
404
407
  params[:document_type] = document_type if document_type
405
408
  params[:email_document_supertype] = email_document_supertype if email_document_supertype
406
409
  params[:government_document_supertype] = government_document_supertype if government_document_supertype
407
- params[:gov_delivery_id] = gov_delivery_id if gov_delivery_id
408
410
  params[:content_purpose_supergroup] = content_purpose_supergroup if content_purpose_supergroup
409
411
  params[:combine_mode] = combine_mode if combine_mode
410
412
 
@@ -1,3 +1,3 @@
1
1
  module GdsApi
2
- VERSION = "67.2.1".freeze
2
+ VERSION = "68.0.0".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: 67.2.1
4
+ version: 68.0.0
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: 2020-12-10 00:00:00.000000000 Z
11
+ date: 2020-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable