unidom-contact-china 1.1.5 → 1.1.6
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: b2f064bf73e9f846dca8553a28ac5c4f5bc81aff
|
4
|
+
data.tar.gz: 27e02218f2d433ddaa41400c75eccf0e51be36a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b4636478eabbb6375275626f72a6869fff83d3b2fdb02d5ad6f6313c4ab54329cc3888cd92047b1ac406791905f2b12caa0b1426744721c8ed146e2ea5267a1
|
7
|
+
data.tar.gz: 3382b9667b9dce683474ec89df8c5ad16dd45486204c52d9733203160c9cf6aa60c5170f52324f48cfd9ba397e5105887c4fa0f18847c9ad4211e9cf01425d0b
|
data/README.md
CHANGED
@@ -81,6 +81,8 @@ end
|
|
81
81
|
|
82
82
|
## RSpec examples
|
83
83
|
|
84
|
+
### RSpec example manifest (run automatically)
|
85
|
+
|
84
86
|
```ruby
|
85
87
|
# spec/models/unidom_spec.rb
|
86
88
|
require 'unidom/contact/china/models_rspec'
|
@@ -91,3 +93,34 @@ require 'unidom/contact/china/types_rspec'
|
|
91
93
|
# spec/validators/unidom_spec.rb
|
92
94
|
require 'unidom/contact/china/validators_rspec'
|
93
95
|
```
|
96
|
+
|
97
|
+
### RSpec shared examples (to be integrated)
|
98
|
+
|
99
|
+
```ruby
|
100
|
+
# lib/unidom.rb
|
101
|
+
def initialize_unidom
|
102
|
+
|
103
|
+
Unidom::Party::Person.class_eval do
|
104
|
+
include Unidom::Contact::China::Concerns::AsMobilePhoneNumberSubscriber
|
105
|
+
end
|
106
|
+
|
107
|
+
end
|
108
|
+
|
109
|
+
# spec/rails_helper.rb
|
110
|
+
require 'unidom'
|
111
|
+
initialize_unidom
|
112
|
+
|
113
|
+
# spec/support/unidom_rspec_shared_examples.rb
|
114
|
+
require 'unidom/contact/china/rspec_shared_examples'
|
115
|
+
|
116
|
+
# spec/models/unidom/party/person_spec.rb
|
117
|
+
describe Unidom::Party::Person, type: :model do
|
118
|
+
|
119
|
+
model_attribtues = {
|
120
|
+
name: 'Tim'
|
121
|
+
}
|
122
|
+
|
123
|
+
it_behaves_like 'Unidom::Contact::China::Concerns::AsMobilePhoneNumberSubscriber', model_attribtues
|
124
|
+
|
125
|
+
end
|
126
|
+
```
|
@@ -0,0 +1,20 @@
|
|
1
|
+
shared_examples 'Unidom::Contact::China::Concerns::AsMobilePhoneNumberSubscriber' do |model_attributes|
|
2
|
+
|
3
|
+
context do
|
4
|
+
|
5
|
+
it_behaves_like 'Unidom::Contact::Concerns::AsSubscriber', model_attributes
|
6
|
+
|
7
|
+
=begin
|
8
|
+
mobile_phone_number_1_attributes = {
|
9
|
+
phone_number: '13901020304'
|
10
|
+
}
|
11
|
+
mobile_phone_number_2_attributes = {
|
12
|
+
phone_number: '13904030201'
|
13
|
+
}
|
14
|
+
|
15
|
+
it_behaves_like 'has_many', model_attributes, :china_mobile_phone_numbers, Unidom::Contact::China::MobilePhoneNumber, [ mobile_phone_number_1_attributes, mobile_phone_number_2_attributes ]
|
16
|
+
=end
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'rspec/models/unidom/contact/china/concerns/as_mobile_phone_number_subscriber_shared_examples'
|
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.
|
4
|
+
version: 1.1.6
|
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-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unidom-contact
|
@@ -55,11 +55,13 @@ files:
|
|
55
55
|
- app/views/layouts/unidom/contact/china/application.html.erb
|
56
56
|
- config/routes.rb
|
57
57
|
- db/migrate/20010391560010_create_unidom_china_mobile_phone_numbers.rb
|
58
|
+
- lib/rspec/models/unidom/contact/china/concerns/as_mobile_phone_number_subscriber_shared_examples.rb
|
58
59
|
- lib/rspec/models/unidom/contact/china/mobile_phone_number_spec.rb
|
59
60
|
- lib/tasks/china_tasks.rake
|
60
61
|
- lib/unidom/contact/china.rb
|
61
62
|
- lib/unidom/contact/china/engine.rb
|
62
63
|
- lib/unidom/contact/china/models_rspec.rb
|
64
|
+
- lib/unidom/contact/china/rspec_shared_examples.rb
|
63
65
|
- lib/unidom/contact/china/types_rspec.rb
|
64
66
|
- lib/unidom/contact/china/validators_rspec.rb
|
65
67
|
- lib/unidom/contact/china/version.rb
|