gds-api-adapters 36.0.0 → 36.0.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/list_response.rb +5 -1
- data/lib/gds_api/version.rb +1 -1
- data/test/publishing_api_test.rb +30 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32b60409e9f3b162e8dbe7f8a34c45359de60cfd
|
4
|
+
data.tar.gz: d8521c663666103d7a84d67d52c750da6e989ff3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c318720e3148b537583771dc8aba4ef80f035e7ce24200fe1592e51aed0f46c5ad63d68ffc1f11abe921fa4e43daa319c2cb983b51517853da545d3e4819089
|
7
|
+
data.tar.gz: ded39f290c4f4c81cb3e30212e03c6ba049a4fec18c19fd49a0df7f60d806e7f5b452f8306d7ae9c59a761dd919afbbf9361c4533ab9b02ac4e4729dd3c300c5
|
@@ -26,7 +26,11 @@ module GdsApi
|
|
26
26
|
# support group_by results from the content api by checking if there is a
|
27
27
|
# grouped_results key present first. if it's not, then fallback to the
|
28
28
|
# results key
|
29
|
-
|
29
|
+
if GdsApi.config.hash_response_for_requests
|
30
|
+
to_hash["grouped_results"] || to_hash["results"]
|
31
|
+
else
|
32
|
+
to_ostruct.grouped_results || to_ostruct.results
|
33
|
+
end
|
30
34
|
end
|
31
35
|
|
32
36
|
def has_next_page?
|
data/lib/gds_api/version.rb
CHANGED
data/test/publishing_api_test.rb
CHANGED
@@ -214,5 +214,35 @@ describe GdsApi::PublishingApi do
|
|
214
214
|
end
|
215
215
|
assert_equal "Unprocessable", error.error_details["error"]["message"]
|
216
216
|
end
|
217
|
+
|
218
|
+
it "returns 200 if an existing path was overridden" do
|
219
|
+
base_path = "/test-item"
|
220
|
+
payload = {
|
221
|
+
publishing_app: "whitehall",
|
222
|
+
override_existing: "true",
|
223
|
+
}
|
224
|
+
|
225
|
+
publishing_api
|
226
|
+
.given("/test-item has been reserved by the Publisher application")
|
227
|
+
.upon_receiving("a request to change publishing app with override_existing set")
|
228
|
+
.with(
|
229
|
+
method: :put,
|
230
|
+
path: "/paths#{base_path}",
|
231
|
+
body: payload,
|
232
|
+
headers: {
|
233
|
+
"Content-Type" => "application/json"
|
234
|
+
},
|
235
|
+
)
|
236
|
+
.will_respond_with(
|
237
|
+
status: 200,
|
238
|
+
body: {},
|
239
|
+
headers: {
|
240
|
+
"Content-Type" => "application/json; charset=utf-8"
|
241
|
+
}
|
242
|
+
)
|
243
|
+
|
244
|
+
response = @api_client.put_path(base_path, payload)
|
245
|
+
assert_equal 200, response.code
|
246
|
+
end
|
217
247
|
end
|
218
248
|
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: 36.0.
|
4
|
+
version: 36.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Stewart
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: plek
|