gds-api-adapters 28.2.0 → 28.2.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
  SHA1:
3
- metadata.gz: b9723069f15e906994434db9e846a9d312f7bdb1
4
- data.tar.gz: 04a3f4851097ca03fbb130f14f32380fa9ee9d0e
3
+ metadata.gz: a48d56e59e4fd8cca477456e5d67b34da6ed997a
4
+ data.tar.gz: 1434904c4e0fea382164a64063ee926affeccc3a
5
5
  SHA512:
6
- metadata.gz: da34eae72d2c0fcf451b4db6376aaa74ac268bd1fee74ef6ad541727e626855a7497e34934f77345c09875a9ff873c06b4de6fbc58c4d4c5ac5d0772230c0fbc
7
- data.tar.gz: 7fb8ebf8449dc9eeb9c63f26d8eb19bc4203d2056ceffca321d776e64ad0b06d371ab262cacc4bca683c3b16c3e1345efbbcbfb6cd3c51e914582a8fadbd66e1
6
+ metadata.gz: b5b8b4e81416537c3fe65b7260283748d7b98166e97aa28a9a10bfe2e9ea621da43b19bb53e1211027bfbba613fc4b97333d30da6bdb0becf2d19c574f310747
7
+ data.tar.gz: 785cb1dbf8b08a8d1d4f48a8229d6a90004c77c415057e5e3b703b73e7f0fc02712977d19d8770b0a35c7197c2578ddb00deabcd5327eaed3d747904fb25e708
@@ -156,7 +156,7 @@ module GdsApi
156
156
 
157
157
  def publishing_api_does_not_have_item(content_id)
158
158
  url = PUBLISHING_API_V2_ENDPOINT + "/content/" + content_id
159
- stub_request(:get, url).to_return(status: 404, body: item_not_found(content_id).to_json, headers: {})
159
+ stub_request(:get, url).to_return(status: 404, body: resource_not_found(content_id, "content item").to_json, headers: {})
160
160
  end
161
161
 
162
162
  def publishing_api_has_links(links)
@@ -165,6 +165,11 @@ module GdsApi
165
165
  stub_request(:get, url).to_return(status: 200, body: links.to_json, headers: {})
166
166
  end
167
167
 
168
+ def publishing_api_does_not_have_links(content_id)
169
+ url = PUBLISHING_API_V2_ENDPOINT + "/links/" + content_id
170
+ stub_request(:get, url).to_return(status: 404, body: resource_not_found(content_id, "link set").to_json, headers: {})
171
+ end
172
+
168
173
  private
169
174
  def stub_publishing_api_put(content_id, body, resource_path, override_response_hash = {})
170
175
  response_hash = {status: 200, body: '{}', headers: {"Content-Type" => "application/json; charset=utf-8"}}
@@ -191,11 +196,11 @@ module GdsApi
191
196
  end
192
197
  end
193
198
 
194
- def item_not_found(content_id)
199
+ def resource_not_found(content_id, type)
195
200
  {
196
201
  error: {
197
202
  code: 404,
198
- message: "Could not find content item with content_id: #{content_id}",
203
+ message: "Could not find #{type} with content_id: #{content_id}",
199
204
  }
200
205
  }
201
206
  end
@@ -1,3 +1,3 @@
1
1
  module GdsApi
2
- VERSION = '28.2.0'
2
+ VERSION = '28.2.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: 28.2.0
4
+ version: 28.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Stewart