gds-api-adapters 4.6.0 → 4.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/gds_api/content_api.rb
CHANGED
@@ -305,16 +305,16 @@ module GdsApi
|
|
305
305
|
"results" => countries.map { |slug, values|
|
306
306
|
updated_at = values.has_key?(:updated_at) ? {"updated_at" => values[:updated_at]} : {}
|
307
307
|
{
|
308
|
-
"id" => "#{CONTENT_API_ENDPOINT}/travel-advice/#{slug}.json",
|
308
|
+
"id" => "#{CONTENT_API_ENDPOINT}/foreign-travel-advice/#{slug}.json",
|
309
309
|
"name" => values[:name],
|
310
310
|
"identifier" => slug,
|
311
|
-
"web_url" => "http://www.test.gov.uk/travel-advice/#{slug}",
|
311
|
+
"web_url" => "http://www.test.gov.uk/foreign-travel-advice/#{slug}",
|
312
312
|
}.merge(updated_at)
|
313
313
|
},
|
314
314
|
"total" => countries.length
|
315
315
|
})
|
316
316
|
|
317
|
-
stub_request(:get, %r{\A#{CONTENT_API_ENDPOINT}/travel-advice\.json}).to_return(status: 200, body: response.to_json, headers: { })
|
317
|
+
stub_request(:get, %r{\A#{CONTENT_API_ENDPOINT}/foreign-travel-advice\.json}).to_return(status: 200, body: response.to_json, headers: { })
|
318
318
|
end
|
319
319
|
|
320
320
|
private
|
data/lib/gds_api/version.rb
CHANGED
data/test/content_api_test.rb
CHANGED
@@ -127,10 +127,10 @@ describe GdsApi::ContentApi do
|
|
127
127
|
end
|
128
128
|
|
129
129
|
it "should be able to fetch artefacts with a '/' in the slug" do
|
130
|
-
content_api_has_an_artefact("travel-advice/aruba")
|
131
|
-
response = @api.artefact("travel-advice/aruba")
|
132
|
-
assert_requested(:get, "#{@base_api_url}/travel-advice%2Faruba.json")
|
133
|
-
assert_equal "#{@base_api_url}/travel-advice%2Faruba.json", response["id"]
|
130
|
+
content_api_has_an_artefact("foreign-travel-advice/aruba")
|
131
|
+
response = @api.artefact("foreign-travel-advice/aruba")
|
132
|
+
assert_requested(:get, "#{@base_api_url}/foreign-travel-advice%2Faruba.json")
|
133
|
+
assert_equal "#{@base_api_url}/foreign-travel-advice%2Faruba.json", response["id"]
|
134
134
|
end
|
135
135
|
end
|
136
136
|
|
@@ -509,8 +509,8 @@ describe GdsApi::ContentApi do
|
|
509
509
|
assert_equal ['afghanistan', 'albania', 'algeria'], @results.map {|c| c['identifier'] }
|
510
510
|
assert_equal ['Afghanistan', 'Albania', 'Algeria'], @results.map {|c| c['name'] }
|
511
511
|
|
512
|
-
assert_equal "#{@base_api_url}/travel-advice/afghanistan.json", @results.first['id']
|
513
|
-
assert_equal 'http://www.test.gov.uk/travel-advice/afghanistan', @results.first['web_url']
|
512
|
+
assert_equal "#{@base_api_url}/foreign-travel-advice/afghanistan.json", @results.first['id']
|
513
|
+
assert_equal 'http://www.test.gov.uk/foreign-travel-advice/afghanistan', @results.first['web_url']
|
514
514
|
end
|
515
515
|
|
516
516
|
it "should parse all updated_at values to Time objects" do
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: gds-api-adapters
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 4.
|
5
|
+
version: 4.7.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- James Stewart
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2013-02-
|
13
|
+
date: 2013-02-14 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: plek
|
@@ -239,7 +239,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
239
239
|
requirements:
|
240
240
|
- - ">="
|
241
241
|
- !ruby/object:Gem::Version
|
242
|
-
hash:
|
242
|
+
hash: 2908169980141436257
|
243
243
|
segments:
|
244
244
|
- 0
|
245
245
|
version: "0"
|
@@ -248,7 +248,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
248
248
|
requirements:
|
249
249
|
- - ">="
|
250
250
|
- !ruby/object:Gem::Version
|
251
|
-
hash:
|
251
|
+
hash: 2908169980141436257
|
252
252
|
segments:
|
253
253
|
- 0
|
254
254
|
version: "0"
|