gds-api-adapters 20.1.2 → 21.0.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/content_api.rb +4 -5
- data/lib/gds_api/test_helpers/content_api.rb +0 -8
- data/lib/gds_api/version.rb +1 -1
- data/test/content_api_test.rb +1 -1
- 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: 6bcaacb3f37eb313895187dd726c2dce6e09170c
|
4
|
+
data.tar.gz: 02f222992af858d36f5ef0f1787e379e77ca88f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b6ac58a27bc20babe9dc54e00f64298ee2b86ad617955e989a511666ff968317848617ea9ae02ab732fe0b8f5288173e996228f6d31ce64829c7348fd387233
|
7
|
+
data.tar.gz: 2a5109ede1a0b00e64f11db81e61c94210783c57090c0692422837160f5318820d81c7a15e55345ccbf5e39890846bf101cc548833df472d6a55b31135408129
|
data/lib/gds_api/content_api.rb
CHANGED
@@ -52,13 +52,12 @@ class GdsApi::ContentApi < GdsApi::Base
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def tag(tag, tag_type=nil)
|
55
|
-
|
56
|
-
|
57
|
-
if tag_type
|
58
|
-
url << "/#{CGI.escape(tag_type)}"
|
55
|
+
if tag_type.nil?
|
56
|
+
raise "Requests for tags without a tag_type are no longer supported. You probably want a tag_type of 'section'. See https://github.com/alphagov/govuk_content_api/blob/f4c0102a1ae4970be6a440707b89798442f768b9/govuk_content_api.rb#L241-L250"
|
59
57
|
end
|
60
58
|
|
61
|
-
|
59
|
+
url = [base_url, "tags", CGI.escape(tag_type), CGI.escape(tag)].join("/") + ".json"
|
60
|
+
get_json(url)
|
62
61
|
end
|
63
62
|
|
64
63
|
def with_tag(tag, tag_type=nil, options={})
|
@@ -62,10 +62,6 @@ module GdsApi
|
|
62
62
|
|
63
63
|
urls = ["#{CONTENT_API_ENDPOINT}/tags/#{CGI.escape(tag_type)}/#{CGI.escape(tag[:slug])}.json"]
|
64
64
|
|
65
|
-
if tag_type == "section"
|
66
|
-
urls << "#{CONTENT_API_ENDPOINT}/tags/#{CGI.escape(tag[:slug])}.json"
|
67
|
-
end
|
68
|
-
|
69
65
|
urls.each do |url|
|
70
66
|
stub_request(:get, url).to_return(status: 200, body: body.to_json, headers: {})
|
71
67
|
end
|
@@ -80,10 +76,6 @@ module GdsApi
|
|
80
76
|
|
81
77
|
urls = ["#{CONTENT_API_ENDPOINT}/tags/#{CGI.escape(tag_type)}/#{CGI.escape(slug)}.json"]
|
82
78
|
|
83
|
-
if tag_type == "section"
|
84
|
-
urls << "#{CONTENT_API_ENDPOINT}/tags/#{CGI.escape(slug)}.json"
|
85
|
-
end
|
86
|
-
|
87
79
|
urls.each do |url|
|
88
80
|
stub_request(:get, url).to_return(status: 404, body: body.to_json, headers: {})
|
89
81
|
end
|
data/lib/gds_api/version.rb
CHANGED
data/test/content_api_test.rb
CHANGED
@@ -364,7 +364,7 @@ describe GdsApi::ContentApi do
|
|
364
364
|
|
365
365
|
it "returns tag information for a section" do
|
366
366
|
content_api_has_section("crime-and-justice")
|
367
|
-
response = @api.tag("crime-and-justice")
|
367
|
+
response = @api.tag("crime-and-justice", "section")
|
368
368
|
|
369
369
|
assert_equal "Crime and justice", response["title"]
|
370
370
|
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:
|
4
|
+
version: 21.0.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: 2015-07-
|
11
|
+
date: 2015-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: plek
|