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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0ad34f7d7d009484cc99f916e4963eb89830733a
4
- data.tar.gz: 19d1e39bfef4736154f26c6f225362e1ca88b42b
3
+ metadata.gz: 32b60409e9f3b162e8dbe7f8a34c45359de60cfd
4
+ data.tar.gz: d8521c663666103d7a84d67d52c750da6e989ff3
5
5
  SHA512:
6
- metadata.gz: b56ad19c715ffeef14cd546a7dae1b0716e02d81c3704a7c8672d5d59c46c1e4b09680ff6cf68c46a2161f266db47716e1daf4966ea85ff0fe5dce7d302460f3
7
- data.tar.gz: 4a9f7b802aa84a1a9e582a473f7d61774be034106c6083dce94914ac8061d60963c8c07dcb029fe276548647544021bdcd6d66b27a9208befdc8598ddad12ef1
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
- to_ostruct.grouped_results || to_ostruct.results
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?
@@ -1,3 +1,3 @@
1
1
  module GdsApi
2
- VERSION = '36.0.0'
2
+ VERSION = '36.0.1'
3
3
  end
@@ -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.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-14 00:00:00.000000000 Z
11
+ date: 2016-09-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: plek