unidom-geo 1.5.2 → 1.5.3

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: 79ead357b337df02de2cd537e2ba3456a522e04a
4
- data.tar.gz: 7128ee1fca23078b603cd0ad9d6a51c3493ae501
3
+ metadata.gz: 30652328bc074b15ae39782751fe51cd3e594663
4
+ data.tar.gz: fb1276a89580c99dbfa0382868c9222b298fd4c4
5
5
  SHA512:
6
- metadata.gz: cbcf720abc0b16245db196f95ea23c1e6c6180fe0a519235983c4f1143528c0e48a0e294cb131db56340d293c10be5f3f80daf7d85f1c3f40931f589a8bf2a44
7
- data.tar.gz: bc207f42cffa75de4d69933c8844673a2e8acb0ab479b0736d60489d15c1e1d01505821746253f862d83cae79fb94fcd5717141a7d7cff254da0402f2a2c265b
6
+ metadata.gz: f9fd2bfa99a15182312169159a89c233a4952f7db1636390be476c57d441bd9f40def605a4cbf4d3388b5c7dbc0f312c6cae32c786ff3df16ac20650c8abef29
7
+ data.tar.gz: 790d5981a2e4c924f4c5058adb9e77910d43c5d98bacef68f91234c3eba1a4baea054384ca414a458d3b495fc7766a3a4d1cbf2e0adf0281536fa595a5724e3b
@@ -18,6 +18,21 @@ describe Unidom::Geo::Locating, type: :model do
18
18
 
19
19
  it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes
20
20
 
21
+ location_attributes = {
22
+ region_id: SecureRandom.uuid,
23
+ region_type: 'Unidom::Geo::Region::Mock',
24
+ longitude: 120.000000,
25
+ latitude: 31.000000,
26
+ postal_address: 'Somewhere',
27
+ postal_code: '812345',
28
+ minimum_longitude: 119.990000,
29
+ minimum_latitude: 30.990000,
30
+ maximum_longitude: 120.010000,
31
+ maximum_latitude: 31.010000
32
+ }
33
+
34
+ it_behaves_like 'belongs_to', model_attributes, :location, Unidom::Geo::Location, location_attributes
35
+
21
36
  end
22
37
 
23
38
  end
@@ -204,6 +204,22 @@ describe Unidom::Geo::Location, type: :model do
204
204
  { postal_code: 'A'*postal_code_max_length } => 0,
205
205
  { postal_code: 'A'*(postal_code_max_length+1) } => 1
206
206
 
207
+ locating_1_attributes = {
208
+ located_id: SecureRandom.uuid,
209
+ located_type: 'Unidom::Geo::Located::Mock',
210
+ locator_id: SecureRandom.uuid,
211
+ locator_type: 'Unidom::Geo::Locator::Mock'
212
+ }
213
+
214
+ locating_2_attributes = {
215
+ located_id: SecureRandom.uuid,
216
+ located_type: 'Unidom::Geo::Located::Mock',
217
+ locator_id: SecureRandom.uuid,
218
+ locator_type: 'Unidom::Geo::Locator::Mock'
219
+ }
220
+
221
+ it_behaves_like 'has_many', model_attributes, :locatings, Unidom::Geo::Locating, [ locating_1_attributes, locating_2_attributes ]
222
+
207
223
  it_behaves_like 'scope', :postal_address_is, [
208
224
  { attributes_collection: [ model_attributes ], count_diff: 1, args: [ 'Somewhere' ] },
209
225
  { attributes_collection: [ model_attributes ], count_diff: 0, args: [ 'Somewhere1' ] },
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Geo
3
- VERSION = '1.5.2'.freeze
3
+ VERSION = '1.5.3'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unidom-geo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.2
4
+ version: 1.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Topbit Du
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-19 00:00:00.000000000 Z
11
+ date: 2017-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unidom-common