gds-api-adapters 69.0.0 → 69.1.0

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: b5de255ce4237b87f433deb2306447f9bda4534d3d85cad5b2ea3053b8d2dda1
4
- data.tar.gz: 2144a904a6f4b3eeb6d0ec0c14b11d680d844f37c432d8c2909f843ce67a6927
3
+ metadata.gz: 30536128d763109b2965438ade68ca08a7bc60782f3ad29f4f874ee051d687ef
4
+ data.tar.gz: 18db0bcda095594ec145e1ab54a6d80b68aa62df2d4348789931b2298d80b9ed
5
5
  SHA512:
6
- metadata.gz: d045fefa180fd19839f9f10db2f6743bfe6e70f916434d486dd1745c8457b2874870f4fbd7f3f46eca5ee010afe9fc01b3b63e625694684d36feae3b69febb4b
7
- data.tar.gz: 812e40c01ab8876121451782fbf6103facfe9dd97f2e1b246a047ef3ec628f116dda681f7de2bdd36dfdc8fafd8ae8ba450bfed00da3b9100a02abd8ee51c78e
6
+ metadata.gz: f488b6b0512fd5a2ae41bad2116c225b2f39446f3d01fe4e493a1d4f0e4673176561dc0a1a79a68f349fc68f92c3b4d14e3cf8a506ffd81a014f22e3a6ad5480
7
+ data.tar.gz: 8cb30f4f8c075c4674a792a9647112268be2a52a77c14c7d20c2ee65f5f2fbcf082e4c6211a6603984426e887a240b0910d4d894575a0f267ba156600e1ed2b5
@@ -15,14 +15,15 @@ class GdsApi::EmailAlertApi < GdsApi::Base
15
15
  raise ArgumentError, message
16
16
  end
17
17
 
18
- create_subscriber_list(attributes)
18
+ post_json("#{endpoint}/subscriber-lists", attributes)
19
19
  end
20
20
 
21
- # Post a subscriber list
21
+ # Get a subscriber list
22
22
  #
23
23
  # @param attributes [Hash] document_type, links, tags used to search existing subscriber lists
24
- def create_subscriber_list(attributes)
25
- post_json("#{endpoint}/subscriber-lists", attributes)
24
+ def find_subscriber_list(attributes)
25
+ query_string = nested_query_string(attributes)
26
+ get_json("#{endpoint}/subscriber-lists?" + query_string)
26
27
  end
27
28
 
28
29
  # Post a content change
@@ -132,6 +132,19 @@ module GdsApi
132
132
  )
133
133
  end
134
134
 
135
+ def stub_email_alert_api_has_subscriber_list(attributes)
136
+ stub_request(:get, build_subscriber_lists_url(attributes))
137
+ .to_return(
138
+ status: 200,
139
+ body: get_subscriber_list_response(attributes).to_json,
140
+ )
141
+ end
142
+
143
+ def stub_email_alert_api_does_not_have_subscriber_list(attributes)
144
+ stub_request(:get, build_subscriber_lists_url(attributes))
145
+ .to_return(status: 404)
146
+ end
147
+
135
148
  def stub_email_alert_api_refuses_to_create_subscriber_list
136
149
  stub_request(:post, build_subscriber_lists_url)
137
150
  .to_return(status: 422)
@@ -1,3 +1,3 @@
1
1
  module GdsApi
2
- VERSION = "69.0.0".freeze
2
+ VERSION = "69.1.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: 69.0.0
4
+ version: 69.1.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: 2021-01-18 00:00:00.000000000 Z
11
+ date: 2021-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable