unidom-contact-china 1.1.1 → 1.1.2

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: 0e80df03f9d7231dfc689ccf040ac2d2faa9cf86
4
- data.tar.gz: d60a9a9c644c0b34dd0cba17f7d905773f7f5c38
3
+ metadata.gz: d21f4ad89f203516e97433a955255c2075f41f36
4
+ data.tar.gz: 1dc8a6c70ad65e68b109b31f924f386904966511
5
5
  SHA512:
6
- metadata.gz: a01709c57671449e5f801c35c9bfdba10b6148b9a60cf890bc91acc0fbd163dc1a976d2fe2321e85ae6e0ed5a37539d727676f7a56564fc07feca52517810491
7
- data.tar.gz: dc32615e86ff1a99b72ca0a4907f6500902db42a6b0e67cefca36c342b052223f77434b9baffa83b88af84090cafc428dc6c2184599ad7a0bd91507cd499febb
6
+ metadata.gz: fe79b4f219350739c1be6e79ed47e47f067b704902172868b97b6a8b4f9beabdf488e35e41a3f42d511cc1d3f81d00645ae595ee5770bd9222a31a0856886430
7
+ data.tar.gz: d6dea9aa5a8e97d7d2a94e35dd22341e7f8b32aef6a5689866d90a7ef6a7a88169e3364f1725ed6b1de60f977298c35490804c6722aba58569cf68e6e0d49aed
@@ -18,7 +18,7 @@ class Unidom::Contact::China::MobilePhoneNumber < Unidom::Contact::China::Applic
18
18
  scope :phone_number_is, ->(phone_number) { where phone_number: phone_number }
19
19
  scope :network_identification_number_is, ->(network_identification_number) { where network_identification_number: network_identification_number }
20
20
  scope :area_code_is, ->(area_code) { where area_code: area_code }
21
- scope :serial_number_is, ->(serial_number) { where serial_number: phone_number }
21
+ scope :serial_number_is, ->(serial_number) { where serial_number: serial_number }
22
22
 
23
23
  before_validation do
24
24
  self.phone_number = phone_number.to_s
@@ -43,6 +43,30 @@ describe Unidom::Contact::China::MobilePhoneNumber, type: :model do
43
43
  { phone_number: '19912345678' } => 0,
44
44
  { phone_number: 'A'*11 } => 2
45
45
 
46
+ it_behaves_like 'scope', :phone_number_is, [
47
+ { attributes_collection: [ model_attributes ], count_diff: 0, args: [ '13912345679' ] },
48
+ { attributes_collection: [ model_attributes ], count_diff: 1, args: [ '13912345678' ] },
49
+ { attributes_collection: [ model_attributes.merge(phone_number: '13812305679') ], count_diff: 1, args: [ '13812305679' ] },
50
+ { attributes_collection: [ model_attributes.merge(phone_number: '13812305679') ], count_diff: 0, args: [ '13912345678' ] } ]
51
+
52
+ it_behaves_like 'scope', :network_identification_number_is, [
53
+ { attributes_collection: [ model_attributes ], count_diff: 0, args: [ '138' ] },
54
+ { attributes_collection: [ model_attributes ], count_diff: 1, args: [ '139' ] },
55
+ { attributes_collection: [ model_attributes.merge(phone_number: '13812305679') ], count_diff: 1, args: [ '138' ] },
56
+ { attributes_collection: [ model_attributes.merge(phone_number: '13812305679') ], count_diff: 0, args: [ '139' ] } ]
57
+
58
+ it_behaves_like 'scope', :area_code_is, [
59
+ { attributes_collection: [ model_attributes ], count_diff: 0, args: [ '1230' ] },
60
+ { attributes_collection: [ model_attributes ], count_diff: 1, args: [ '1234' ] },
61
+ { attributes_collection: [ model_attributes.merge(phone_number: '13812305679') ], count_diff: 1, args: [ '1230' ] },
62
+ { attributes_collection: [ model_attributes.merge(phone_number: '13812305679') ], count_diff: 0, args: [ '1234' ] } ]
63
+
64
+ it_behaves_like 'scope', :serial_number_is, [
65
+ { attributes_collection: [ model_attributes ], count_diff: 0, args: [ '5679' ] },
66
+ { attributes_collection: [ model_attributes ], count_diff: 1, args: [ '5678' ] },
67
+ { attributes_collection: [ model_attributes.merge(phone_number: '13812305679') ], count_diff: 1, args: [ '5679' ] },
68
+ { attributes_collection: [ model_attributes.merge(phone_number: '13812305679') ], count_diff: 0, args: [ '5678' ] } ]
69
+
46
70
  end
47
71
 
48
72
  end
@@ -1,7 +1,7 @@
1
1
  module Unidom
2
2
  module Contact
3
3
  module China
4
- VERSION = '1.1.1'.freeze
4
+ VERSION = '1.1.2'.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-contact-china
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
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-17 00:00:00.000000000 Z
11
+ date: 2017-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unidom-contact