gds-api-adapters 41.5.0 → 42.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/local_links_manager.rb +2 -3
- data/lib/gds_api/test_helpers/local_links_manager.rb +8 -40
- data/lib/gds_api/version.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: 9edc882ebeb3e95db4c4e987f90d0c63f38b31cc
|
4
|
+
data.tar.gz: b54e4ab7afa3ebe3f937329725f54a54ede78bf4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57ae20e9f2eea3448b79a3361680f967e6f8497f8a6e1c430a1b9c4f390037dad6b3dec0ff45c02a0ba17cc6e7bfd55de6d3f5f45d07b2bec8f83587f750e12f
|
7
|
+
data.tar.gz: 3d96ad5027362587fade8b41136adf33039fb25c88ea1451a464ebb3b3c8d70283de1a28ca8e3940893404657b8ee94c3d55b98eeef2d4e9187d8ef0703e8e72
|
@@ -1,9 +1,8 @@
|
|
1
1
|
require_relative 'base'
|
2
2
|
|
3
3
|
class GdsApi::LocalLinksManager < GdsApi::Base
|
4
|
-
def local_link(authority_slug, lgsl, lgil
|
5
|
-
url = "#{endpoint}/api/link?authority_slug=#{authority_slug}&lgsl=#{lgsl}"
|
6
|
-
url += "&lgil=#{lgil}" if lgil
|
4
|
+
def local_link(authority_slug, lgsl, lgil)
|
5
|
+
url = "#{endpoint}/api/link?authority_slug=#{authority_slug}&lgsl=#{lgsl}&lgil=#{lgil}"
|
7
6
|
get_json(url)
|
8
7
|
end
|
9
8
|
|
@@ -55,53 +55,21 @@ module GdsApi
|
|
55
55
|
.to_return(body: response.to_json, status: 200)
|
56
56
|
end
|
57
57
|
|
58
|
-
def
|
59
|
-
response = {
|
60
|
-
"local_authority" => {
|
61
|
-
"name" => authority_slug.capitalize,
|
62
|
-
"snac" => "00AG",
|
63
|
-
"tier" => "unitary",
|
64
|
-
"homepage_url" => "http://#{authority_slug}.example.com",
|
65
|
-
},
|
66
|
-
"local_interaction" => {
|
67
|
-
"lgsl_code" => lgsl,
|
68
|
-
"lgil_code" => lgil,
|
69
|
-
"url" => url,
|
70
|
-
}
|
71
|
-
}
|
72
|
-
|
73
|
-
stub_request(:get, "#{LOCAL_LINKS_MANAGER_ENDPOINT}/api/link")
|
74
|
-
.with(query: { authority_slug: authority_slug, lgsl: lgsl })
|
75
|
-
.to_return(body: response.to_json, status: 200)
|
76
|
-
end
|
77
|
-
|
78
|
-
def local_links_manager_has_no_fallback_link(authority_slug:, lgsl:)
|
79
|
-
response = {
|
80
|
-
"local_authority" => {
|
81
|
-
"name" => authority_slug.capitalize,
|
82
|
-
"snac" => "00AG",
|
83
|
-
"tier" => "unitary",
|
84
|
-
"homepage_url" => "http://#{authority_slug}.example.com",
|
85
|
-
},
|
86
|
-
}
|
87
|
-
|
88
|
-
stub_request(:get, "#{LOCAL_LINKS_MANAGER_ENDPOINT}/api/link")
|
89
|
-
.with(query: { authority_slug: authority_slug, lgsl: lgsl })
|
90
|
-
.to_return(body: response.to_json, status: 200)
|
91
|
-
end
|
92
|
-
|
93
|
-
def local_links_manager_request_with_missing_parameters(authority_slug, lgsl)
|
58
|
+
def local_links_manager_request_with_missing_parameters(authority_slug, lgsl, lgil)
|
94
59
|
# convert nil to an empty string, otherwise query param is not expressed correctly
|
95
|
-
params = {
|
60
|
+
params = {
|
61
|
+
authority_slug: authority_slug || "",
|
62
|
+
lgsl: lgsl || "",
|
63
|
+
lgil: lgil || "",
|
64
|
+
}
|
96
65
|
|
97
66
|
stub_request(:get, "#{LOCAL_LINKS_MANAGER_ENDPOINT}/api/link")
|
98
67
|
.with(query: params)
|
99
68
|
.to_return(body: {}.to_json, status: 400)
|
100
69
|
end
|
101
70
|
|
102
|
-
def local_links_manager_does_not_have_required_objects(authority_slug, lgsl, lgil
|
103
|
-
params = { authority_slug: authority_slug, lgsl: lgsl }
|
104
|
-
params[:lgil] = lgil if lgil
|
71
|
+
def local_links_manager_does_not_have_required_objects(authority_slug, lgsl, lgil)
|
72
|
+
params = { authority_slug: authority_slug, lgsl: lgsl, lgil: lgil }
|
105
73
|
|
106
74
|
stub_request(:get, "#{LOCAL_LINKS_MANAGER_ENDPOINT}/api/link")
|
107
75
|
.with(query: params)
|
data/lib/gds_api/version.rb
CHANGED
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: 42.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: 2017-04-
|
11
|
+
date: 2017-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: plek
|