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 +4 -4
- data/lib/gds_api/publishing_api_v2.rb +14 -2
- data/lib/gds_api/version.rb +1 -1
- data/test/publishing_api_v2_test.rb +8 -4
- 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: f9b62c3d717ced2cf4a1606042f7a30d2671b1b5
|
4
|
+
data.tar.gz: 9a40bc142cc071a324b834347f8410f221a14140
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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 = {})
|
data/lib/gds_api/version.rb
CHANGED
@@ -875,14 +875,14 @@ describe GdsApi::PublishingApiV2 do
|
|
875
875
|
]
|
876
876
|
}
|
877
877
|
|
878
|
-
it "returns the content items of a given
|
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: "
|
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(
|
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
|
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.
|
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-
|
11
|
+
date: 2016-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: plek
|