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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7eba58aeeebf0ea1b6be0bffa08238c5a96ce163
4
- data.tar.gz: b4f7113077a1275bab3cb7fa1ac988ee6c6590df
3
+ metadata.gz: 79d15b6fd807103c6fc88870512f1e3c3d341858
4
+ data.tar.gz: 000f3511afdf25a9c4746da4a43d82fe283580cb
5
5
  SHA512:
6
- metadata.gz: ed3922b6fb4140eb2d898c37a445d599abd07b27373d99f460c74729aa571a3c32101e7c28994439528b14988ba5b3a006bc9dfa65fcf12dd468f26d60f321c7
7
- data.tar.gz: babd4186cd34303667edefc54919cceaab5dd750505228da12425ce2d83e3cbfd8228ca330998403f448f9cef591e6d92ae2d2d389568dc24464b92e5e119afd
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
- stub_publishing_api_put(content_id, body, '/links')
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(:put, %r{\A#{PUBLISHING_API_V2_ENDPOINT}/links/})
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(:put, url, attributes_or_matcher, times)
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(content_id, body, resource_path, override_response_hash = {})
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(:put, url).with(body: body).to_return(response_hash)
192
+ stub_request(method, url).with(body: body).to_return(response_hash)
185
193
  end
186
194
 
187
195
  def deep_stringify_keys(hash)
@@ -1,3 +1,3 @@
1
1
  module GdsApi
2
- VERSION = '29.1.0'
2
+ VERSION = '29.1.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gds-api-adapters
3
3
  version: !ruby/object:Gem::Version
4
- version: 29.1.0
4
+ version: 29.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Stewart