gds-api-adapters 28.2.0 → 28.2.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 +8 -3
- 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: a48d56e59e4fd8cca477456e5d67b34da6ed997a
|
4
|
+
data.tar.gz: 1434904c4e0fea382164a64063ee926affeccc3a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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:
|
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
|
199
|
+
def resource_not_found(content_id, type)
|
195
200
|
{
|
196
201
|
error: {
|
197
202
|
code: 404,
|
198
|
-
message: "Could not find
|
203
|
+
message: "Could not find #{type} with content_id: #{content_id}",
|
199
204
|
}
|
200
205
|
}
|
201
206
|
end
|
data/lib/gds_api/version.rb
CHANGED