mas-rad_core 0.0.92 → 0.0.93
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.
- checksums.yaml +4 -4
- data/lib/mas/firm_result.rb +3 -1
- data/lib/mas/rad_core/version.rb +1 -1
- data/spec/lib/mas/firm_result_spec.rb +18 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d2a8227f36efeb170c22a80d1729459adf5cbc4a
|
4
|
+
data.tar.gz: 0f58fcce801724fedc42db65b218d787d8c199f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d17c8c7961c8e7c9597d8a4c14783fd93d030bd631e16e9c803052305d69ac02a984be4a36d288e2a8abf37843b6e46ce495e49085f7fc642de19067e9cb227
|
7
|
+
data.tar.gz: 0a486a7b0f347cdb5ba1af905632b11485c6856eb6122ae293feda093c1a185a57f29fd1422c861ea92c5de8a4918c4eb67ee6f7fc00fbfd9ac6b046b963a28f
|
data/lib/mas/firm_result.rb
CHANGED
@@ -62,7 +62,9 @@ class FirmResult
|
|
62
62
|
end
|
63
63
|
|
64
64
|
def offices
|
65
|
-
@offices
|
65
|
+
@offices
|
66
|
+
.map { |office_data| OfficeResult.new(office_data) }
|
67
|
+
.sort { |a, b| a.address_town <=> b.address_town }
|
66
68
|
end
|
67
69
|
|
68
70
|
def includes_advice_type?(advice_type)
|
data/lib/mas/rad_core/version.rb
CHANGED
@@ -41,6 +41,18 @@ RSpec.describe FirmResult do
|
|
41
41
|
}
|
42
42
|
],
|
43
43
|
'offices' => [
|
44
|
+
{
|
45
|
+
'_id' => 456,
|
46
|
+
'address_line_one' => 'c/o Jess the Cat',
|
47
|
+
'address_line_two' => 'Maude St',
|
48
|
+
'address_town' => 'Kendal',
|
49
|
+
'address_county' => 'Cumbria',
|
50
|
+
'address_postcode' => 'LA9 4QD',
|
51
|
+
'email_address' => 'postie@example.com',
|
52
|
+
'telephone_number' => '5555 555 5555',
|
53
|
+
'disabled_access' => true,
|
54
|
+
'location' => { 'lat' => 51.428473, 'lon' => -0.943616 }
|
55
|
+
},
|
44
56
|
{
|
45
57
|
'_id' => 123,
|
46
58
|
'address_line_one' => 'c/o Postman Pat',
|
@@ -127,7 +139,7 @@ RSpec.describe FirmResult do
|
|
127
139
|
end
|
128
140
|
|
129
141
|
it 'maps the total_offices' do
|
130
|
-
expect(subject.total_offices).to eq(
|
142
|
+
expect(subject.total_offices).to eq(2)
|
131
143
|
end
|
132
144
|
|
133
145
|
it 'maps the `types_of_advice` that are greater than 0 percent' do
|
@@ -170,12 +182,16 @@ RSpec.describe FirmResult do
|
|
170
182
|
describe '#offices' do
|
171
183
|
it 'returns an array containing the offices' do
|
172
184
|
expect(subject.offices).to be_an(Array)
|
173
|
-
expect(subject.offices.length).to eq(
|
185
|
+
expect(subject.offices.length).to eq(2)
|
174
186
|
end
|
175
187
|
|
176
188
|
it 'returns OfficeResult objects' do
|
177
189
|
expect(subject.offices.first).to be_an(OfficeResult)
|
178
190
|
end
|
191
|
+
|
192
|
+
it 'orders by the town name' do
|
193
|
+
expect(subject.offices.map(&:address_town)).to eq(['Greendale', 'Kendal'])
|
194
|
+
end
|
179
195
|
end
|
180
196
|
|
181
197
|
describe '#minimum_pot_size?' do
|