gds-api-adapters 29.1.0 → 29.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gds_api/test_helpers/publishing_api_v2.rb +13 -5
- data/lib/gds_api/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 79d15b6fd807103c6fc88870512f1e3c3d341858
|
4
|
+
data.tar.gz: 000f3511afdf25a9c4746da4a43d82fe283580cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e2d59c5d0ed42723b7a559fcf95cd54a75c12a8fb986900157639ad5457445c29d63059c6e70868ea406a3212c1a6fc6eaf4f75cc89029a41a85117c9cfb029d
|
7
|
+
data.tar.gz: aa2d16f162b3f6a383db6e79518a0d693815978c4513047e26feab6882f4dcadd729a06f214ed81dfcb9a60fc78f18eca4c4978766a6bf90ade67107dc2c968e
|
@@ -27,7 +27,7 @@ module GdsApi
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def stub_publishing_api_patch_links(content_id, body)
|
30
|
-
|
30
|
+
stub_publishing_api_patch(content_id, body, '/links')
|
31
31
|
end
|
32
32
|
|
33
33
|
def stub_publishing_api_publish(content_id, body)
|
@@ -58,7 +58,7 @@ module GdsApi
|
|
58
58
|
end
|
59
59
|
|
60
60
|
def stub_any_publishing_api_patch_links
|
61
|
-
stub_request(:
|
61
|
+
stub_request(:patch, %r{\A#{PUBLISHING_API_V2_ENDPOINT}/links/})
|
62
62
|
end
|
63
63
|
|
64
64
|
def stub_any_publishing_api_call
|
@@ -97,7 +97,7 @@ module GdsApi
|
|
97
97
|
|
98
98
|
def assert_publishing_api_patch_links(content_id, attributes_or_matcher = nil, times = 1)
|
99
99
|
url = PUBLISHING_API_V2_ENDPOINT + "/links/" + content_id
|
100
|
-
assert_publishing_api(:
|
100
|
+
assert_publishing_api(:patch, url, attributes_or_matcher, times)
|
101
101
|
end
|
102
102
|
|
103
103
|
def assert_publishing_api_discard_draft(content_id, attributes_or_matcher = nil, times = 1)
|
@@ -176,12 +176,20 @@ module GdsApi
|
|
176
176
|
end
|
177
177
|
|
178
178
|
private
|
179
|
-
def stub_publishing_api_put(
|
179
|
+
def stub_publishing_api_put(*args)
|
180
|
+
stub_publishing_api_postlike_call(:put, *args)
|
181
|
+
end
|
182
|
+
|
183
|
+
def stub_publishing_api_patch(*args)
|
184
|
+
stub_publishing_api_postlike_call(:patch, *args)
|
185
|
+
end
|
186
|
+
|
187
|
+
def stub_publishing_api_postlike_call(method, content_id, body, resource_path, override_response_hash = {})
|
180
188
|
response_hash = {status: 200, body: '{}', headers: {"Content-Type" => "application/json; charset=utf-8"}}
|
181
189
|
response_hash.merge!(override_response_hash)
|
182
190
|
response_hash[:body] = response_hash[:body].to_json if response_hash[:body].is_a?(Hash)
|
183
191
|
url = PUBLISHING_API_V2_ENDPOINT + resource_path + "/" + content_id
|
184
|
-
stub_request(
|
192
|
+
stub_request(method, url).with(body: body).to_return(response_hash)
|
185
193
|
end
|
186
194
|
|
187
195
|
def deep_stringify_keys(hash)
|
data/lib/gds_api/version.rb
CHANGED