mas-rad_core 0.0.92 → 0.0.93

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c597a13c9aa2b9144988a58066d2abd459af4776
4
- data.tar.gz: 0f510fbed49813ed5a1383b9323964c8e9c3be9a
3
+ metadata.gz: d2a8227f36efeb170c22a80d1729459adf5cbc4a
4
+ data.tar.gz: 0f58fcce801724fedc42db65b218d787d8c199f3
5
5
  SHA512:
6
- metadata.gz: e877bac277a0c7a68aeb0ae0849de5a2f080f5dcd19b3cdeffcf5cb71601108ef2f3a9ed5587d9622f10a14fdaab8102be3faeeb29e7aad2130e54fe4bf3109c
7
- data.tar.gz: a6ab192e0ce2048dd268da4f2b9ae3093c56e73e5fca00638a0ae80e8477eb155536cd61768bc8dbc1b9f8a24bbf0f514a1efa753889ecdd63447da0dd7e4325
6
+ metadata.gz: 4d17c8c7961c8e7c9597d8a4c14783fd93d030bd631e16e9c803052305d69ac02a984be4a36d288e2a8abf37843b6e46ce495e49085f7fc642de19067e9cb227
7
+ data.tar.gz: 0a486a7b0f347cdb5ba1af905632b11485c6856eb6122ae293feda093c1a185a57f29fd1422c861ea92c5de8a4918c4eb67ee6f7fc00fbfd9ac6b046b963a28f
@@ -62,7 +62,9 @@ class FirmResult
62
62
  end
63
63
 
64
64
  def offices
65
- @offices.map { |office_data| OfficeResult.new(office_data) }
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)
@@ -1,5 +1,5 @@
1
1
  module MAS
2
2
  module RadCore
3
- VERSION = '0.0.92'
3
+ VERSION = '0.0.93'
4
4
  end
5
5
  end
@@ -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(1)
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(1)
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mas-rad_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.92
4
+ version: 0.0.93
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Lovell