twfy 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -0
- data/.travis.yml +1 -2
- data/lib/twfy.rb +1 -1
- data/lib/twfy/api.rb +1 -1
- data/lib/twfy/mp.rb +1 -1
- data/lib/twfy/version.rb +1 -1
- data/test/fixtures/vcr_cassettes/Twfy_Client/constituencies/works.yml +436 -0
- data/test/fixtures/vcr_cassettes/Twfy_Client/constituency/works.yml +46 -0
- data/test/fixtures/vcr_cassettes/Twfy_Client/convert_url/works.yml +44 -0
- data/test/fixtures/vcr_cassettes/Twfy_Client/geometry/works.yml +88 -0
- data/test/fixtures/vcr_cassettes/Twfy_Client/mp_and_mp_info/works.yml +607 -0
- data/test/fixtures/vcr_cassettes/Twfy_Client/mps/works.yml +4174 -0
- data/test/fixtures/vcr_cassettes/Twfy_Client/msps/works.yml +191 -0
- data/test/fixtures/vcr_cassettes/Twfy_DataElement/is_equivalent_to_use_a_simple_chain_or_direct_call.yml +1163 -0
- data/test/fixtures/vcr_cassettes/Twfy_DataElement/works_for_a_reflexive_chain.yml +99 -0
- data/test/fixtures/vcr_cassettes/Twfy_DataElement/works_for_a_round_trip_chain.yml +99 -0
- data/test/fixtures/vcr_cassettes/Twfy_DataElement/works_for_a_single_chain.yml +51 -0
- data/test/fixtures/vcr_cassettes/Twfy_DataElement/works_for_an_overkill_chain.yml +141 -0
- data/test/lib/twfy/client_test.rb +59 -38
- data/test/lib/twfy/data_element_test.rb +45 -42
- data/test/test_helper.rb +8 -15
- data/twfy.gemspec +3 -1
- metadata +76 -27
- data/test/fixtures/vcr_cassettes/client_test.yml +0 -2723
- data/test/fixtures/vcr_cassettes/data_element_test.yml +0 -240
@@ -1,240 +0,0 @@
|
|
1
|
-
---
|
2
|
-
http_interactions:
|
3
|
-
- request:
|
4
|
-
method: get
|
5
|
-
uri: http://www.theyworkforyou.com/api/getMP?key=<API_KEY>&postcode=IP6%209PN&version=1.0.0
|
6
|
-
body:
|
7
|
-
encoding: US-ASCII
|
8
|
-
string: ''
|
9
|
-
headers:
|
10
|
-
Accept-Encoding:
|
11
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
12
|
-
Accept:
|
13
|
-
- '*/*'
|
14
|
-
User-Agent:
|
15
|
-
- Ruby
|
16
|
-
response:
|
17
|
-
status:
|
18
|
-
code: 200
|
19
|
-
message: OK
|
20
|
-
headers:
|
21
|
-
Last-Modified:
|
22
|
-
- Fri, 07 May 2010 02:51:26 +0100
|
23
|
-
Content-Type:
|
24
|
-
- text/javascript; charset=iso-8859-1
|
25
|
-
X-Url:
|
26
|
-
- /api/getMP?postcode=IP6+9PN&key=<API_KEY>&version=1.0.0
|
27
|
-
Content-Length:
|
28
|
-
- '506'
|
29
|
-
Accept-Ranges:
|
30
|
-
- bytes
|
31
|
-
Date:
|
32
|
-
- Wed, 13 Nov 2013 00:52:16 GMT
|
33
|
-
Age:
|
34
|
-
- '3'
|
35
|
-
Connection:
|
36
|
-
- keep-alive
|
37
|
-
body:
|
38
|
-
encoding: UTF-8
|
39
|
-
string: '{"member_id":"40156","house":"1","first_name":"Daniel","last_name":"Poulter","constituency":"Central
|
40
|
-
Suffolk and North Ipswich","party":"Conservative","entered_house":"2010-05-06","left_house":"9999-12-31","entered_reason":"general_election","left_reason":"still_in_office","person_id":"24756","title":"","lastupdate":"2010-05-07
|
41
|
-
02:51:26","full_name":"Daniel Poulter","url":"/mp/24756/daniel_poulter/central_suffolk_and_north_ipswich","image":"/images/mpsL/24756.jpeg","image_height":118,"image_width":78}'
|
42
|
-
http_version:
|
43
|
-
recorded_at: Wed, 13 Nov 2013 00:52:16 GMT
|
44
|
-
- request:
|
45
|
-
method: get
|
46
|
-
uri: http://www.theyworkforyou.com/api/getGeometry?key=<API_KEY>&name=Central%20Suffolk%20and%20North%20Ipswich&version=1.0.0
|
47
|
-
body:
|
48
|
-
encoding: US-ASCII
|
49
|
-
string: ''
|
50
|
-
headers:
|
51
|
-
Accept-Encoding:
|
52
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
53
|
-
Accept:
|
54
|
-
- '*/*'
|
55
|
-
User-Agent:
|
56
|
-
- Ruby
|
57
|
-
response:
|
58
|
-
status:
|
59
|
-
code: 200
|
60
|
-
message: OK
|
61
|
-
headers:
|
62
|
-
Content-Type:
|
63
|
-
- text/javascript; charset=iso-8859-1
|
64
|
-
X-Url:
|
65
|
-
- /api/getGeometry?name=Central+Suffolk+and+North+Ipswich&key=<API_KEY>&version=1.0.0
|
66
|
-
Content-Length:
|
67
|
-
- '359'
|
68
|
-
Accept-Ranges:
|
69
|
-
- bytes
|
70
|
-
Date:
|
71
|
-
- Wed, 13 Nov 2013 00:52:16 GMT
|
72
|
-
Age:
|
73
|
-
- '4'
|
74
|
-
Connection:
|
75
|
-
- keep-alive
|
76
|
-
body:
|
77
|
-
encoding: UTF-8
|
78
|
-
string: '{"max_e":636672.1,"srid_en":27700,"area":796226596.18,"max_n":283760.6,"min_lat":52.0407410207,"max_lat":52.4044029233,"centre_n":263028.158509,"max_lon":1.46434493435,"centre_lon":1.22112407587,"min_n":242895.4,"parts":1,"centre_e":620106.539681,"min_e":602204.5,"min_lon":0.951515301231,"centre_lat":52.2215670245,"name":"Central
|
79
|
-
Suffolk and North Ipswich"}'
|
80
|
-
http_version:
|
81
|
-
recorded_at: Wed, 13 Nov 2013 00:52:17 GMT
|
82
|
-
- request:
|
83
|
-
method: get
|
84
|
-
uri: http://www.theyworkforyou.com/api/getMPInfo?id=24756&key=<API_KEY>&version=1.0.0
|
85
|
-
body:
|
86
|
-
encoding: US-ASCII
|
87
|
-
string: ''
|
88
|
-
headers:
|
89
|
-
Accept-Encoding:
|
90
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
91
|
-
Accept:
|
92
|
-
- '*/*'
|
93
|
-
User-Agent:
|
94
|
-
- Ruby
|
95
|
-
response:
|
96
|
-
status:
|
97
|
-
code: 200
|
98
|
-
message: OK
|
99
|
-
headers:
|
100
|
-
Last-Modified:
|
101
|
-
- Tue, 12 Nov 2013 03:38:59 +0000
|
102
|
-
Content-Type:
|
103
|
-
- text/javascript; charset=iso-8859-1
|
104
|
-
X-Url:
|
105
|
-
- /api/getMPInfo?id=24756&key=<API_KEY>&version=1.0.0
|
106
|
-
Content-Length:
|
107
|
-
- '6072'
|
108
|
-
Accept-Ranges:
|
109
|
-
- bytes
|
110
|
-
Date:
|
111
|
-
- Wed, 13 Nov 2013 00:52:16 GMT
|
112
|
-
Age:
|
113
|
-
- '4'
|
114
|
-
Connection:
|
115
|
-
- keep-alive
|
116
|
-
body:
|
117
|
-
encoding: UTF-8
|
118
|
-
string: '{"comments_on_speeches":"2","comments_on_speeches_quintile":"3","comments_on_speeches_rank":"450","comments_on_speeches_rank_joint":"48","comments_on_speeches_rank_outof":"650","debate_sectionsspoken_inlastyear":"32","debate_sectionsspoken_inlastyear_quintile":"2","debate_sectionsspoken_inlastyear_rank":"314","debate_sectionsspoken_inlastyear_rank_joint":"8","debate_sectionsspoken_inlastyear_rank_outof":"650","maiden_speech":"uk.org.publicwhip/debate/2010-06-22c.151.6","public_whip_dreammp1052_absent":"0","public_whip_dreammp1052_both_voted":"2","public_whip_dreammp1052_distance":"0","public_whip_dreammp1053_absent":"0","public_whip_dreammp1053_both_voted":"1","public_whip_dreammp1053_distance":"0","public_whip_dreammp1065_absent":"0","public_whip_dreammp1065_both_voted":"4","public_whip_dreammp1065_distance":"0.0833333","public_whip_dreammp1074_absent":"1","public_whip_dreammp1074_both_voted":"10","public_whip_dreammp1074_distance":"0.0641026","public_whip_dreammp1084_absent":"0","public_whip_dreammp1084_both_voted":"1","public_whip_dreammp1084_distance":"1","public_whip_dreammp1109_absent":"0","public_whip_dreammp1109_both_voted":"2","public_whip_dreammp1109_distance":"0","public_whip_dreammp1110_absent":"0","public_whip_dreammp1110_both_voted":"10","public_whip_dreammp1110_distance":"0","public_whip_dreammp1124_absent":"0","public_whip_dreammp1124_both_voted":"1","public_whip_dreammp1124_distance":"0","public_whip_dreammp1132_absent":"0","public_whip_dreammp1132_both_voted":"1","public_whip_dreammp1132_distance":"0","public_whip_dreammp811_absent":"0","public_whip_dreammp811_both_voted":"1","public_whip_dreammp811_distance":"0","public_whip_dreammp826_absent":"0","public_whip_dreammp826_both_voted":"4","public_whip_dreammp826_distance":"0","public_whip_dreammp984_absent":"0","public_whip_dreammp984_both_voted":"1","public_whip_dreammp984_distance":"0","reading_ease":"47.0414979003198","reading_ease_quintile":"4","reading_ease_rank":"534","reading_ease_rank_outof":"645","reading_year":"14.2795015913675","reading_year_quintile":"0","reading_year_rank":"81","reading_year_rank_outof":"645","register_member_interests_date":"2013-10-28","register_member_interests_html":"<div
|
119
|
-
class=\"regmemcategory\">2. Remunerated employment, office, profession etc</div>\n<div
|
120
|
-
class=\"regmemitem\"> Medical doctor</div>\n","select_committees":"0","select_committees_chair":"0","three_word_alliterations":"167","three_word_alliterations_quintile":"2","three_word_alliterations_rank":"363","three_word_alliterations_rank_joint":"2","three_word_alliterations_rank_outof":"650","three_word_alliteration_content":":to
|
121
|
-
take to:will work with:make my maiden:true that throughout:he has had:that
|
122
|
-
the treatment:it is important:that the true:the time that:the time to:and
|
123
|
-
about a:to trust them:it is impossible:think that there:should support such:to
|
124
|
-
tailor their:has he had:is invest in:it is important:to talk to:profit per
|
125
|
-
pig:it is important:onus on our:when we were:time to time:industry is in:be
|
126
|
-
bad because:should show some:after an ageing:through talking therapies:on
|
127
|
-
one of:bodies being bandied:it is important:important in improving:and alcohol
|
128
|
-
abuse:to try to:whereas\n\nwhat we:if it is:when we were:thanks to the:that
|
129
|
-
the two:all agree about:that they take:which we will:the train through:to
|
130
|
-
tackle the:think that there:important issue in:it is in:it is important:to
|
131
|
-
tackle these:to tackle this:it is important:tribute to the:it is important:investment
|
132
|
-
in increasing:support system should:women whom we:save social services:it
|
133
|
-
is important:the time that:specialist surgical services:it is important:it
|
134
|
-
is important:it is important:it is important:together to try:it is important:and
|
135
|
-
as a:work with women:way we would:at an average:has huge health:it is important:workers
|
136
|
-
who work:be brought back:party political points:not necessarily need:tribute
|
137
|
-
to the:it is important:why we would:trusts throughout the:interest in it:that
|
138
|
-
these things:also attracted attention:to travel to:important it is:the time
|
139
|
-
they:taking the time:turn to the:are available across:tribute to the:to talk
|
140
|
-
to:training thanks to:it is important:to tackle the:are already available:and
|
141
|
-
an ageing:reducing readmission rates:tribute to the:it is important:together
|
142
|
-
to talk:are at a:say something specifically:to try to:to take things:to their
|
143
|
-
task:to the trust:to talk through:operate out of:transfer times to:that the
|
144
|
-
trust:that the trust:thought that the:accrued as a:that trust to:that the
|
145
|
-
time:and accident and:to the table:to tackle that:it is irresponsible:the
|
146
|
-
talking therapies:it is important:and at a:it is important:testament to the:against
|
147
|
-
accident and:it is important:an accident and:it is ironic:that the trust:is
|
148
|
-
important in:it is important:to the task:tribute to the:funding formula for:formula
|
149
|
-
for funding:appointed as a:true that tariff:tribute to the:is implicit in:to
|
150
|
-
the topics:to their task:investing in integration:the trust to:that the trust:the
|
151
|
-
trust to:to talk through:tribute to the:are also amending:about as a:to talk
|
152
|
-
that:and are a:are anticipating a:and an ageing:issues in improving:tools
|
153
|
-
that the:to talk this:tribute to the:thanks to the:what went wrong:to try
|
154
|
-
to:thanks to the:to tackle them:it is important:and appropriate and:trying
|
155
|
-
to tighten","wikipedia_url":"http://en.wikipedia.org/wiki/Daniel_Poulter","wrans_answered_inlastyear":"1291","wrans_asked_inlastyear":"0","wrans_asked_inlastyear_quintile":"4","wrans_asked_inlastyear_rank":"525","wrans_asked_inlastyear_rank_joint":"126","wrans_asked_inlastyear_rank_outof":"650","wrans_departments":"Health,
|
156
|
-
Education, Environment Food and Rural Affairs, Energy and Climate Change,
|
157
|
-
Transport","wrans_subjects":"Poultry: Animal Welfare, General Practitioners,
|
158
|
-
NHS: Pensions, Ambulance Services: Standards, NHS: Drugs","by_member_id":{"40156":{"public_whip_division_attendance":"81.52%","public_whip_data_date":"2013-11-08","public_whip_rebellions":"1.92%","public_whip_rebelrank":"108","public_whip_attendrank":"163","public_whip_rebelrank_outof":"643","public_whip_attendrank_outof":"650"}}}'
|
159
|
-
http_version:
|
160
|
-
recorded_at: Wed, 13 Nov 2013 00:52:17 GMT
|
161
|
-
- request:
|
162
|
-
method: get
|
163
|
-
uri: http://www.theyworkforyou.com/api/getMPInfo?id=24756&key=<API_KEY>&version=1.0.0
|
164
|
-
body:
|
165
|
-
encoding: US-ASCII
|
166
|
-
string: ''
|
167
|
-
headers:
|
168
|
-
Accept-Encoding:
|
169
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
170
|
-
Accept:
|
171
|
-
- '*/*'
|
172
|
-
User-Agent:
|
173
|
-
- Ruby
|
174
|
-
response:
|
175
|
-
status:
|
176
|
-
code: 200
|
177
|
-
message: OK
|
178
|
-
headers:
|
179
|
-
Last-Modified:
|
180
|
-
- Tue, 12 Nov 2013 03:38:59 +0000
|
181
|
-
Content-Type:
|
182
|
-
- text/javascript; charset=iso-8859-1
|
183
|
-
X-Url:
|
184
|
-
- /api/getMPInfo?id=24756&key=<API_KEY>&version=1.0.0
|
185
|
-
Content-Length:
|
186
|
-
- '6072'
|
187
|
-
Accept-Ranges:
|
188
|
-
- bytes
|
189
|
-
Date:
|
190
|
-
- Wed, 13 Nov 2013 00:52:17 GMT
|
191
|
-
Age:
|
192
|
-
- '4'
|
193
|
-
Connection:
|
194
|
-
- keep-alive
|
195
|
-
body:
|
196
|
-
encoding: UTF-8
|
197
|
-
string: '{"comments_on_speeches":"2","comments_on_speeches_quintile":"3","comments_on_speeches_rank":"450","comments_on_speeches_rank_joint":"48","comments_on_speeches_rank_outof":"650","debate_sectionsspoken_inlastyear":"32","debate_sectionsspoken_inlastyear_quintile":"2","debate_sectionsspoken_inlastyear_rank":"314","debate_sectionsspoken_inlastyear_rank_joint":"8","debate_sectionsspoken_inlastyear_rank_outof":"650","maiden_speech":"uk.org.publicwhip/debate/2010-06-22c.151.6","public_whip_dreammp1052_absent":"0","public_whip_dreammp1052_both_voted":"2","public_whip_dreammp1052_distance":"0","public_whip_dreammp1053_absent":"0","public_whip_dreammp1053_both_voted":"1","public_whip_dreammp1053_distance":"0","public_whip_dreammp1065_absent":"0","public_whip_dreammp1065_both_voted":"4","public_whip_dreammp1065_distance":"0.0833333","public_whip_dreammp1074_absent":"1","public_whip_dreammp1074_both_voted":"10","public_whip_dreammp1074_distance":"0.0641026","public_whip_dreammp1084_absent":"0","public_whip_dreammp1084_both_voted":"1","public_whip_dreammp1084_distance":"1","public_whip_dreammp1109_absent":"0","public_whip_dreammp1109_both_voted":"2","public_whip_dreammp1109_distance":"0","public_whip_dreammp1110_absent":"0","public_whip_dreammp1110_both_voted":"10","public_whip_dreammp1110_distance":"0","public_whip_dreammp1124_absent":"0","public_whip_dreammp1124_both_voted":"1","public_whip_dreammp1124_distance":"0","public_whip_dreammp1132_absent":"0","public_whip_dreammp1132_both_voted":"1","public_whip_dreammp1132_distance":"0","public_whip_dreammp811_absent":"0","public_whip_dreammp811_both_voted":"1","public_whip_dreammp811_distance":"0","public_whip_dreammp826_absent":"0","public_whip_dreammp826_both_voted":"4","public_whip_dreammp826_distance":"0","public_whip_dreammp984_absent":"0","public_whip_dreammp984_both_voted":"1","public_whip_dreammp984_distance":"0","reading_ease":"47.0414979003198","reading_ease_quintile":"4","reading_ease_rank":"534","reading_ease_rank_outof":"645","reading_year":"14.2795015913675","reading_year_quintile":"0","reading_year_rank":"81","reading_year_rank_outof":"645","register_member_interests_date":"2013-10-28","register_member_interests_html":"<div
|
198
|
-
class=\"regmemcategory\">2. Remunerated employment, office, profession etc</div>\n<div
|
199
|
-
class=\"regmemitem\"> Medical doctor</div>\n","select_committees":"0","select_committees_chair":"0","three_word_alliterations":"167","three_word_alliterations_quintile":"2","three_word_alliterations_rank":"363","three_word_alliterations_rank_joint":"2","three_word_alliterations_rank_outof":"650","three_word_alliteration_content":":to
|
200
|
-
take to:will work with:make my maiden:true that throughout:he has had:that
|
201
|
-
the treatment:it is important:that the true:the time that:the time to:and
|
202
|
-
about a:to trust them:it is impossible:think that there:should support such:to
|
203
|
-
tailor their:has he had:is invest in:it is important:to talk to:profit per
|
204
|
-
pig:it is important:onus on our:when we were:time to time:industry is in:be
|
205
|
-
bad because:should show some:after an ageing:through talking therapies:on
|
206
|
-
one of:bodies being bandied:it is important:important in improving:and alcohol
|
207
|
-
abuse:to try to:whereas\n\nwhat we:if it is:when we were:thanks to the:that
|
208
|
-
the two:all agree about:that they take:which we will:the train through:to
|
209
|
-
tackle the:think that there:important issue in:it is in:it is important:to
|
210
|
-
tackle these:to tackle this:it is important:tribute to the:it is important:investment
|
211
|
-
in increasing:support system should:women whom we:save social services:it
|
212
|
-
is important:the time that:specialist surgical services:it is important:it
|
213
|
-
is important:it is important:it is important:together to try:it is important:and
|
214
|
-
as a:work with women:way we would:at an average:has huge health:it is important:workers
|
215
|
-
who work:be brought back:party political points:not necessarily need:tribute
|
216
|
-
to the:it is important:why we would:trusts throughout the:interest in it:that
|
217
|
-
these things:also attracted attention:to travel to:important it is:the time
|
218
|
-
they:taking the time:turn to the:are available across:tribute to the:to talk
|
219
|
-
to:training thanks to:it is important:to tackle the:are already available:and
|
220
|
-
an ageing:reducing readmission rates:tribute to the:it is important:together
|
221
|
-
to talk:are at a:say something specifically:to try to:to take things:to their
|
222
|
-
task:to the trust:to talk through:operate out of:transfer times to:that the
|
223
|
-
trust:that the trust:thought that the:accrued as a:that trust to:that the
|
224
|
-
time:and accident and:to the table:to tackle that:it is irresponsible:the
|
225
|
-
talking therapies:it is important:and at a:it is important:testament to the:against
|
226
|
-
accident and:it is important:an accident and:it is ironic:that the trust:is
|
227
|
-
important in:it is important:to the task:tribute to the:funding formula for:formula
|
228
|
-
for funding:appointed as a:true that tariff:tribute to the:is implicit in:to
|
229
|
-
the topics:to their task:investing in integration:the trust to:that the trust:the
|
230
|
-
trust to:to talk through:tribute to the:are also amending:about as a:to talk
|
231
|
-
that:and are a:are anticipating a:and an ageing:issues in improving:tools
|
232
|
-
that the:to talk this:tribute to the:thanks to the:what went wrong:to try
|
233
|
-
to:thanks to the:to tackle them:it is important:and appropriate and:trying
|
234
|
-
to tighten","wikipedia_url":"http://en.wikipedia.org/wiki/Daniel_Poulter","wrans_answered_inlastyear":"1291","wrans_asked_inlastyear":"0","wrans_asked_inlastyear_quintile":"4","wrans_asked_inlastyear_rank":"525","wrans_asked_inlastyear_rank_joint":"126","wrans_asked_inlastyear_rank_outof":"650","wrans_departments":"Health,
|
235
|
-
Education, Environment Food and Rural Affairs, Energy and Climate Change,
|
236
|
-
Transport","wrans_subjects":"Poultry: Animal Welfare, General Practitioners,
|
237
|
-
NHS: Pensions, Ambulance Services: Standards, NHS: Drugs","by_member_id":{"40156":{"public_whip_division_attendance":"81.52%","public_whip_data_date":"2013-11-08","public_whip_rebellions":"1.92%","public_whip_rebelrank":"108","public_whip_attendrank":"163","public_whip_rebelrank_outof":"643","public_whip_attendrank_outof":"650"}}}'
|
238
|
-
http_version:
|
239
|
-
recorded_at: Wed, 13 Nov 2013 00:52:18 GMT
|
240
|
-
recorded_with: VCR 2.5.0
|