gds-api-adapters 18.4.0 → 18.5.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/test_helpers/rummager.rb +33 -0
- data/lib/gds_api/version.rb +1 -1
- data/test/fixtures/4_new_policies_for_dwp.json +104 -0
- data/test/fixtures/4_old_policies_for_dwp.json +182 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 919dffdccf96237db74ef931b5c6faae4e6d22e3
|
4
|
+
data.tar.gz: eaab2b00d6af70a9f3ffa3dd5ec1c3f3e10a83eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33e38a256ab4308f129eb5a6394c060e5c41ae12e8fac02832b92ea3ff1c9c6f38f97c6515b580573b4edb2165fc8edc2fd4fe492eaa8f80cc595378a7fa46fb
|
7
|
+
data.tar.gz: e46d51533058c74f011c7df68fe3a5601e3674fbc11a96a4b9eb411b18375e00c7bda25f61a2459a3eacd448a96235a5d1788a9408c25be64ab621a09e9898df
|
@@ -49,6 +49,21 @@ module GdsApi
|
|
49
49
|
run_example_query
|
50
50
|
end
|
51
51
|
|
52
|
+
def rummager_has_no_policies_for_any_organisation
|
53
|
+
stub_request(:get, %r{/unified_search.json})
|
54
|
+
.to_return(body: no_search_results_found)
|
55
|
+
end
|
56
|
+
|
57
|
+
def rummager_has_four_new_policies_for_every_organisation
|
58
|
+
stub_request(:get, %r{/unified_search.json})
|
59
|
+
.to_return(body: four_new_policies_results)
|
60
|
+
end
|
61
|
+
|
62
|
+
def rummager_has_four_old_policies_for_every_organisation
|
63
|
+
stub_request(:get, %r{/unified_search.json})
|
64
|
+
.to_return(body: four_old_policies_results)
|
65
|
+
end
|
66
|
+
|
52
67
|
private
|
53
68
|
def stub_request_for(result_set)
|
54
69
|
stub_request(:get, /example.com\/unified_search/).to_return(body: result_set)
|
@@ -85,6 +100,24 @@ module GdsApi
|
|
85
100
|
)
|
86
101
|
end
|
87
102
|
|
103
|
+
def four_new_policies_results
|
104
|
+
File.read(
|
105
|
+
File.expand_path(
|
106
|
+
"../../../../test/fixtures/4_new_policies_for_dwp.json",
|
107
|
+
__FILE__
|
108
|
+
)
|
109
|
+
)
|
110
|
+
end
|
111
|
+
|
112
|
+
def four_old_policies_results
|
113
|
+
File.read(
|
114
|
+
File.expand_path(
|
115
|
+
"../../../../test/fixtures/4_old_policies_for_dwp.json",
|
116
|
+
__FILE__
|
117
|
+
)
|
118
|
+
)
|
119
|
+
end
|
120
|
+
|
88
121
|
def client
|
89
122
|
GdsApi::Rummager.new("http://example.com")
|
90
123
|
end
|
data/lib/gds_api/version.rb
CHANGED
@@ -0,0 +1,104 @@
|
|
1
|
+
{
|
2
|
+
"results": [
|
3
|
+
{
|
4
|
+
"title": "Welfare reform",
|
5
|
+
"description": "The governments policy on welfare reform",
|
6
|
+
"link": "/government/policies/welfare-reform",
|
7
|
+
"slug": "welfare-reform",
|
8
|
+
"format": "policy",
|
9
|
+
"organisations": [
|
10
|
+
{
|
11
|
+
"slug": "department-for-work-pensions",
|
12
|
+
"link": "/government/organisations/department-for-work-pensions",
|
13
|
+
"title": "Department for Work and Pensions",
|
14
|
+
"acronym": "DWP",
|
15
|
+
"organisation_type": "Ministerial department",
|
16
|
+
"organisation_state": "live"
|
17
|
+
}
|
18
|
+
],
|
19
|
+
"public_timestamp": "2015-04-23T09:31:18.369Z",
|
20
|
+
"index": "mainstream",
|
21
|
+
"es_score": null,
|
22
|
+
"_id": "/government/policies/welfare-reform",
|
23
|
+
"document_type": "policy"
|
24
|
+
},
|
25
|
+
{
|
26
|
+
"title": "State Pension simplification",
|
27
|
+
"description": "The governments policy on state pension simplification",
|
28
|
+
"link": "/government/policies/state-pension-simplification",
|
29
|
+
"slug": "state-pension-simplification",
|
30
|
+
"format": "policy",
|
31
|
+
"organisations": [
|
32
|
+
{
|
33
|
+
"slug": "department-for-work-pensions",
|
34
|
+
"link": "/government/organisations/department-for-work-pensions",
|
35
|
+
"title": "Department for Work and Pensions",
|
36
|
+
"acronym": "DWP",
|
37
|
+
"organisation_type": "Ministerial department",
|
38
|
+
"organisation_state": "live"
|
39
|
+
}
|
40
|
+
],
|
41
|
+
"public_timestamp": "2015-04-23T09:31:16.374Z",
|
42
|
+
"index": "mainstream",
|
43
|
+
"es_score": null,
|
44
|
+
"_id": "/government/policies/state-pension-simplification",
|
45
|
+
"document_type": "policy"
|
46
|
+
},
|
47
|
+
{
|
48
|
+
"title": "State Pension age",
|
49
|
+
"description": "The governments policy on state pension age",
|
50
|
+
"link": "/government/policies/state-pension-age",
|
51
|
+
"slug": "state-pension-age",
|
52
|
+
"format": "policy",
|
53
|
+
"organisations": [
|
54
|
+
{
|
55
|
+
"slug": "department-for-work-pensions",
|
56
|
+
"link": "/government/organisations/department-for-work-pensions",
|
57
|
+
"title": "Department for Work and Pensions",
|
58
|
+
"acronym": "DWP",
|
59
|
+
"organisation_type": "Ministerial department",
|
60
|
+
"organisation_state": "live"
|
61
|
+
}
|
62
|
+
],
|
63
|
+
"public_timestamp": "2015-04-23T09:31:16.279Z",
|
64
|
+
"index": "mainstream",
|
65
|
+
"es_score": null,
|
66
|
+
"_id": "/government/policies/state-pension-age",
|
67
|
+
"document_type": "policy"
|
68
|
+
},
|
69
|
+
{
|
70
|
+
"title": "Poverty and social justice",
|
71
|
+
"description": "The governments policy on poverty and social justice",
|
72
|
+
"link": "/government/policies/poverty-and-social-justice",
|
73
|
+
"slug": "poverty-and-social-justice",
|
74
|
+
"format": "policy",
|
75
|
+
"organisations": [
|
76
|
+
{
|
77
|
+
"slug": "department-for-work-pensions",
|
78
|
+
"link": "/government/organisations/department-for-work-pensions",
|
79
|
+
"title": "Department for Work and Pensions",
|
80
|
+
"acronym": "DWP",
|
81
|
+
"organisation_type": "Ministerial department",
|
82
|
+
"organisation_state": "live"
|
83
|
+
},
|
84
|
+
{
|
85
|
+
"slug": "department-for-education",
|
86
|
+
"link": "/government/organisations/department-for-education",
|
87
|
+
"title": "Department for Education",
|
88
|
+
"acronym": "DfE",
|
89
|
+
"organisation_type": "Ministerial department",
|
90
|
+
"organisation_state": "live"
|
91
|
+
}
|
92
|
+
],
|
93
|
+
"public_timestamp": "2015-04-23T09:31:13.699Z",
|
94
|
+
"index": "mainstream",
|
95
|
+
"es_score": null,
|
96
|
+
"_id": "/government/policies/poverty-and-social-justice",
|
97
|
+
"document_type": "policy"
|
98
|
+
}
|
99
|
+
],
|
100
|
+
"total": 11,
|
101
|
+
"start": 0,
|
102
|
+
"facets": {},
|
103
|
+
"suggested_queries": []
|
104
|
+
}
|
@@ -0,0 +1,182 @@
|
|
1
|
+
{
|
2
|
+
"results": [
|
3
|
+
{
|
4
|
+
"topics": [
|
5
|
+
{
|
6
|
+
"slug": "employment",
|
7
|
+
"link": "/government/topics/employment",
|
8
|
+
"title": "Employment"
|
9
|
+
},
|
10
|
+
{
|
11
|
+
"slug": "welfare",
|
12
|
+
"link": "/government/topics/welfare",
|
13
|
+
"title": "Welfare"
|
14
|
+
}
|
15
|
+
],
|
16
|
+
"title": "Employment",
|
17
|
+
"description": "How the government is getting Britain working and helping people break the cycle of benefit dependency.",
|
18
|
+
"link": "/government/policies/helping-people-to-find-and-stay-in-work",
|
19
|
+
"format": "policy",
|
20
|
+
"display_type": "Policy",
|
21
|
+
"organisations": [
|
22
|
+
{
|
23
|
+
"slug": "department-for-work-pensions",
|
24
|
+
"link": "/government/organisations/department-for-work-pensions",
|
25
|
+
"title": "Department for Work and Pensions",
|
26
|
+
"acronym": "DWP",
|
27
|
+
"organisation_type": "Ministerial department",
|
28
|
+
"organisation_state": "live"
|
29
|
+
},
|
30
|
+
{
|
31
|
+
"slug": "hm-treasury",
|
32
|
+
"link": "/government/organisations/hm-treasury",
|
33
|
+
"title": "HM Treasury",
|
34
|
+
"acronym": "HMT",
|
35
|
+
"organisation_type": "Ministerial department",
|
36
|
+
"organisation_state": "live"
|
37
|
+
}
|
38
|
+
],
|
39
|
+
"public_timestamp": "2015-03-26T15:06:42.000+00:00",
|
40
|
+
"index": "government",
|
41
|
+
"es_score": null,
|
42
|
+
"_id": "/government/policies/helping-people-to-find-and-stay-in-work",
|
43
|
+
"document_type": "edition"
|
44
|
+
},
|
45
|
+
{
|
46
|
+
"topics": [
|
47
|
+
{
|
48
|
+
"slug": "energy",
|
49
|
+
"link": "/government/topics/energy",
|
50
|
+
"title": "Energy"
|
51
|
+
},
|
52
|
+
{
|
53
|
+
"slug": "climate-change",
|
54
|
+
"link": "/government/topics/climate-change",
|
55
|
+
"title": "Climate change"
|
56
|
+
}
|
57
|
+
],
|
58
|
+
"title": "Household energy",
|
59
|
+
"description": "How we're helping households to save on their energy bills and supporting people in fuel poverty.",
|
60
|
+
"link": "/government/policies/helping-households-to-cut-their-energy-bills",
|
61
|
+
"format": "policy",
|
62
|
+
"display_type": "Policy",
|
63
|
+
"organisations": [
|
64
|
+
{
|
65
|
+
"slug": "department-for-communities-and-local-government",
|
66
|
+
"link": "/government/organisations/department-for-communities-and-local-government",
|
67
|
+
"title": "Department for Communities and Local Government",
|
68
|
+
"acronym": "DCLG",
|
69
|
+
"organisation_type": "Ministerial department",
|
70
|
+
"organisation_state": "live"
|
71
|
+
},
|
72
|
+
{
|
73
|
+
"slug": "department-for-work-pensions",
|
74
|
+
"link": "/government/organisations/department-for-work-pensions",
|
75
|
+
"title": "Department for Work and Pensions",
|
76
|
+
"acronym": "DWP",
|
77
|
+
"organisation_type": "Ministerial department",
|
78
|
+
"organisation_state": "live"
|
79
|
+
},
|
80
|
+
{
|
81
|
+
"slug": "department-of-energy-climate-change",
|
82
|
+
"link": "/government/organisations/department-of-energy-climate-change",
|
83
|
+
"title": "Department of Energy & Climate Change",
|
84
|
+
"acronym": "DECC",
|
85
|
+
"organisation_type": "Ministerial department",
|
86
|
+
"organisation_state": "live"
|
87
|
+
},
|
88
|
+
{
|
89
|
+
"slug": "ofgem",
|
90
|
+
"link": "/government/organisations/ofgem",
|
91
|
+
"title": "Ofgem",
|
92
|
+
"organisation_state": "exempt"
|
93
|
+
}
|
94
|
+
],
|
95
|
+
"public_timestamp": "2015-03-26T11:40:02.000+00:00",
|
96
|
+
"index": "government",
|
97
|
+
"es_score": null,
|
98
|
+
"_id": "/government/policies/helping-households-to-cut-their-energy-bills",
|
99
|
+
"document_type": "edition"
|
100
|
+
},
|
101
|
+
{
|
102
|
+
"topics": [
|
103
|
+
{
|
104
|
+
"slug": "welfare",
|
105
|
+
"link": "/government/topics/welfare",
|
106
|
+
"title": "Welfare"
|
107
|
+
},
|
108
|
+
{
|
109
|
+
"slug": "community-and-society",
|
110
|
+
"link": "/government/topics/community-and-society",
|
111
|
+
"title": "Community and society"
|
112
|
+
}
|
113
|
+
],
|
114
|
+
"title": "Poverty and social justice",
|
115
|
+
"description": "How the government is working to help people overcome complex problems that lead to poverty, to help them change the course of their lives",
|
116
|
+
"link": "/government/policies/helping-to-reduce-poverty-and-improve-social-justice",
|
117
|
+
"format": "policy",
|
118
|
+
"display_type": "Policy",
|
119
|
+
"organisations": [
|
120
|
+
{
|
121
|
+
"slug": "department-for-education",
|
122
|
+
"link": "/government/organisations/department-for-education",
|
123
|
+
"title": "Department for Education",
|
124
|
+
"acronym": "DfE",
|
125
|
+
"organisation_type": "Ministerial department",
|
126
|
+
"organisation_state": "live"
|
127
|
+
},
|
128
|
+
{
|
129
|
+
"slug": "department-for-work-pensions",
|
130
|
+
"link": "/government/organisations/department-for-work-pensions",
|
131
|
+
"title": "Department for Work and Pensions",
|
132
|
+
"acronym": "DWP",
|
133
|
+
"organisation_type": "Ministerial department",
|
134
|
+
"organisation_state": "live"
|
135
|
+
}
|
136
|
+
],
|
137
|
+
"public_timestamp": "2014-10-22T16:15:41.000+01:00",
|
138
|
+
"index": "government",
|
139
|
+
"es_score": null,
|
140
|
+
"_id": "/government/policies/helping-to-reduce-poverty-and-improve-social-justice",
|
141
|
+
"document_type": "edition"
|
142
|
+
},
|
143
|
+
{
|
144
|
+
"topics": [
|
145
|
+
{
|
146
|
+
"slug": "employment",
|
147
|
+
"link": "/government/topics/employment",
|
148
|
+
"title": "Employment"
|
149
|
+
},
|
150
|
+
{
|
151
|
+
"slug": "welfare",
|
152
|
+
"link": "/government/topics/welfare",
|
153
|
+
"title": "Welfare"
|
154
|
+
}
|
155
|
+
],
|
156
|
+
"title": "Welfare reform",
|
157
|
+
"description": "Making the welfare system fairer, more affordable and better able to reduce poverty, worklessness and welfare dependency.",
|
158
|
+
"link": "/government/policies/simplifying-the-welfare-system-and-making-sure-work-pays",
|
159
|
+
"format": "policy",
|
160
|
+
"display_type": "Policy",
|
161
|
+
"organisations": [
|
162
|
+
{
|
163
|
+
"slug": "department-for-work-pensions",
|
164
|
+
"link": "/government/organisations/department-for-work-pensions",
|
165
|
+
"title": "Department for Work and Pensions",
|
166
|
+
"acronym": "DWP",
|
167
|
+
"organisation_type": "Ministerial department",
|
168
|
+
"organisation_state": "live"
|
169
|
+
}
|
170
|
+
],
|
171
|
+
"public_timestamp": "2014-10-22T11:30:00.000+01:00",
|
172
|
+
"index": "government",
|
173
|
+
"es_score": null,
|
174
|
+
"_id": "/government/policies/simplifying-the-welfare-system-and-making-sure-work-pays",
|
175
|
+
"document_type": "edition"
|
176
|
+
}
|
177
|
+
],
|
178
|
+
"total": 11,
|
179
|
+
"start": 0,
|
180
|
+
"facets": {},
|
181
|
+
"suggested_queries": []
|
182
|
+
}
|
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: 18.
|
4
|
+
version: 18.5.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-04-
|
11
|
+
date: 2015-04-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: plek
|
@@ -357,6 +357,8 @@ files:
|
|
357
357
|
- test/fact_cave_test.rb
|
358
358
|
- test/finder_api_test.rb
|
359
359
|
- test/finder_schema_test.rb
|
360
|
+
- test/fixtures/4_new_policies_for_dwp.json
|
361
|
+
- test/fixtures/4_old_policies_for_dwp.json
|
360
362
|
- test/fixtures/finder_api/cma-case-schema.json
|
361
363
|
- test/fixtures/hello.txt
|
362
364
|
- test/fixtures/no_services_and_info_data_found_fixture.json
|
@@ -447,6 +449,8 @@ test_files:
|
|
447
449
|
- test/fixtures/world_organisations_australia.json
|
448
450
|
- test/fixtures/no_services_and_info_data_found_fixture.json
|
449
451
|
- test/fixtures/services_and_info_fixture.json
|
452
|
+
- test/fixtures/4_old_policies_for_dwp.json
|
453
|
+
- test/fixtures/4_new_policies_for_dwp.json
|
450
454
|
- test/fixtures/sub_sector_organisations.json
|
451
455
|
- test/fixtures/finder_api/cma-case-schema.json
|
452
456
|
- test/router_test.rb
|