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: 26f4bb9bbd9b42da25765062f576c42dfd84ae65
4
- data.tar.gz: 9cdc8de26b0642a4b1928058b17b27209e2c849a
3
+ metadata.gz: 064eb05711633c7d7c9b7782ada25a80d0d2e80e
4
+ data.tar.gz: 79c2b92279fc00f87600702cca2eb913f9c9268e
5
5
  SHA512:
6
- metadata.gz: 3d4f001bf8a2ec71d6bc87deb6eae159b53d3a9142458edc6b42f13b0f4f8fcbde17a2e8adb4f993babaa571f9e3287b06199add24e1c7435c1508489584a326
7
- data.tar.gz: 367c1bcbf847cf4ff20865e332389cf5fa626182d377efb587702d8e4f7a275a9db93cc70996a4f970928930035eb1083ba680d374ce8a55fb34899ee13c21bc
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
@@ -1,7 +1,7 @@
1
1
  module Unidom
2
2
  module Geo
3
3
  module China
4
- VERSION = '0.5.3'.freeze
4
+ VERSION = '0.5.4'.freeze
5
5
  end
6
6
  end
7
7
  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.3
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-03 00:00:00.000000000 Z
11
+ date: 2017-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unidom-geo