unidom-geo-china 0.5.3 → 0.5.4
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 064eb05711633c7d7c9b7782ada25a80d0d2e80e
|
4
|
+
data.tar.gz: 79c2b92279fc00f87600702cca2eb913f9c9268e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e11f3f65a285c07bce3dbce22d0966f89fab403b5e04ddf9e55da06291dec65f6526b092c9a924e1a50f65d149d38aba125b700eef6a1edeed36e655290a29c8
|
7
|
+
data.tar.gz: 395a06db555e8cc45887c737f3b98dc1b70df0b43b335d84e03bf07f6493ca3b40b14abaab3f1355a9145f22196050f3f323a196099fca3656c377a283fb999f
|
@@ -81,6 +81,22 @@ describe Unidom::Geo::China::Region, type: :model do
|
|
81
81
|
|
82
82
|
it_behaves_like 'has_many', model_attributes, :towns, Unidom::Geo::China::Town, [ town_1_attributes, town_2_attributes ]
|
83
83
|
|
84
|
+
it_behaves_like 'scope', :name_is, [
|
85
|
+
{ attributes_collection: [ model_attributes ], count_diff: 1, args: [ model_attributes[:name] ] },
|
86
|
+
{ attributes_collection: [ model_attributes ], count_diff: 0, args: [ 'Another Region' ] },
|
87
|
+
{ attributes_collection: [ model_attributes.merge(name: 'Another Region') ], count_diff: 0, args: [ model_attributes[:name] ] },
|
88
|
+
{ attributes_collection: [ model_attributes.merge(name: 'Another Region') ], count_diff: 1, args: [ 'Another Region' ] }
|
89
|
+
]
|
90
|
+
|
91
|
+
it_behaves_like 'scope', :being_virtual, [
|
92
|
+
{ attributes_collection: [ model_attributes ], count_diff: 0, args: [ ] },
|
93
|
+
{ attributes_collection: [ model_attributes ], count_diff: 0, args: [ true ] },
|
94
|
+
{ attributes_collection: [ model_attributes ], count_diff: 1, args: [ false ] },
|
95
|
+
{ attributes_collection: [ model_attributes.merge(virtual: true) ], count_diff: 1, args: [ ] },
|
96
|
+
{ attributes_collection: [ model_attributes.merge(virtual: true) ], count_diff: 1, args: [ true ] },
|
97
|
+
{ attributes_collection: [ model_attributes.merge(virtual: true) ], count_diff: 0, args: [ false ] }
|
98
|
+
]
|
99
|
+
|
84
100
|
end
|
85
101
|
|
86
102
|
end
|
@@ -63,6 +63,8 @@ describe Unidom::Geo::China::Town, type: :model do
|
|
63
63
|
|
64
64
|
it_behaves_like 'belongs_to', model_attributes, :region, Unidom::Geo::China::Region, region_attributes
|
65
65
|
|
66
|
+
it_behaves_like 'monomorphic scope', model_attributes, :region_is, :region
|
67
|
+
|
66
68
|
end
|
67
69
|
|
68
70
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unidom-geo-china
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.4
|
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-03-
|
11
|
+
date: 2017-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unidom-geo
|