gds-api-adapters 29.2.0 → 29.3.0

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: dcbcf83df995ff4cdd0002f989cc9e4032cd7470
4
- data.tar.gz: 8eaabd463ed9176934ea0adb6bb67bf4b7ec1947
3
+ metadata.gz: f9b62c3d717ced2cf4a1606042f7a30d2671b1b5
4
+ data.tar.gz: 9a40bc142cc071a324b834347f8410f221a14140
5
5
  SHA512:
6
- metadata.gz: 1020031ea15ed8ac360b783f1ad57b765c1ed4aefa521ce65c2a5b0f4eed014cf19468f039e07a3f8a7e3c71e5bee4e56eab63af91a80d362a441be2dbf2c638
7
- data.tar.gz: 844a5785f27a1e5168c65bf5d5fa4acd9b5640b42982896203178ff2c4e1758edf11f0d5e036cbdcf8ffb0bfd95679bfa1f60fd072d2984a024e9339665c8b59
6
+ metadata.gz: 0dfbf18074c8c8116668b3d1e42d5e566794de5fdd76f4fcdf15a3540be8758c3e8e059285e31f71e2802c403cac17fc5ad2e45da17070af256da21771398be1
7
+ data.tar.gz: 681f7782f9ca6e2753a4ea5165233b8f3d504861ce60c5989860fce7978b0db75e0255bbd62b3ee0d6cc62328eefee9664124cbe45c720f4c07967cd04aa96c1
@@ -78,8 +78,20 @@ class GdsApi::PublishingApiV2 < GdsApi::Base
78
78
  get_json("#{endpoint}/v2/content#{query}")
79
79
  end
80
80
 
81
- def get_linkables(format:)
82
- get_json("#{endpoint}/v2/linkables?format=#{format}")
81
+ def get_linkables(document_type: nil, format: nil)
82
+ if document_type.nil?
83
+ if format.nil?
84
+ raise ArgumentError.new("Please provide a `document_type`")
85
+ else
86
+ self.class.logger.warn(
87
+ "Providing `format` to the `get_linkables` method is deprecated and will be removed in a " +
88
+ "future release. Please use `document_type` instead."
89
+ )
90
+ document_type = format
91
+ end
92
+ end
93
+
94
+ get_json("#{endpoint}/v2/linkables?document_type=#{document_type}")
83
95
  end
84
96
 
85
97
  def get_linked_items(content_id, params = {})
@@ -1,3 +1,3 @@
1
1
  module GdsApi
2
- VERSION = '29.2.0'
2
+ VERSION = '29.3.0'
3
3
  end
@@ -875,14 +875,14 @@ describe GdsApi::PublishingApiV2 do
875
875
  ]
876
876
  }
877
877
 
878
- it "returns the content items of a given format" do
878
+ it "returns the content items of a given document_type" do
879
879
  publishing_api
880
880
  .given("there is content with format 'topic'")
881
881
  .upon_receiving("a get linkables request")
882
882
  .with(
883
883
  method: :get,
884
884
  path: "/v2/linkables",
885
- query: "format=topic",
885
+ query: "document_type=topic",
886
886
  headers: {
887
887
  "Content-Type" => "application/json",
888
888
  },
@@ -892,8 +892,12 @@ describe GdsApi::PublishingApiV2 do
892
892
  body: linkables,
893
893
  )
894
894
 
895
- response = @api_client.get_linkables(format: "topic")
895
+ response = @api_client.get_linkables(document_type: "topic")
896
+ assert_equal 200, response.code
897
+ assert_equal linkables, response.to_a
896
898
 
899
+ # `format` is supported but deprecated for backwards compatibility
900
+ response = @api_client.get_linkables(format: "topic")
897
901
  assert_equal 200, response.code
898
902
  assert_equal linkables, response.to_a
899
903
  end
@@ -1174,7 +1178,7 @@ describe GdsApi::PublishingApiV2 do
1174
1178
  end
1175
1179
  end
1176
1180
 
1177
- describe "there are two documents that link to the wantend document" do
1181
+ describe "there are two documents that link to the wanted document" do
1178
1182
  before do
1179
1183
  content_id2 = "08dfd5c3-d935-4e81-88fd-cfe65b78893d"
1180
1184
  content_id3 = "e2961462-bc37-48e9-bb98-c981ef1a2d59"
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: 29.2.0
4
+ version: 29.3.0
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-03-03 00:00:00.000000000 Z
11
+ date: 2016-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: plek