unidom-contact 1.3.5 → 1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +15 -0
- data/app/models/unidom/contact/contact_subscription.rb +0 -2
- data/lib/rspec/models/unidom/contact/contact_subscription_spec.rb +23 -0
- data/lib/rspec/models/unidom/contact/email_address_spec.rb +20 -0
- data/lib/unidom/contact/models_rspec.rb +2 -0
- data/lib/unidom/contact/types_rspec.rb +0 -0
- data/lib/unidom/contact/validators_rspec.rb +0 -0
- data/lib/unidom/contact/version.rb +1 -1
- metadata +7 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f92027a30bb1656c21c247f66048446e0f4156b5
|
|
4
|
+
data.tar.gz: 1fede8e9a05da9232209c3ee2a97a5acd0b05c77
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 48dd22339d50ae676bce792edfdf0ed1fc3eacbcbfca6f907879bd2c27e9c6966097a3be421064c2fb033cd0578e4285ebd99335e2bc0a251dd297f852e0d941
|
|
7
|
+
data.tar.gz: f96bd9bef4dd37ddbd2d89b40b603d81af278eacc0dee283d2104993781197b2278ee102003f5c7a4c00fc49d9d1d72d452c1350d706e8bb2844060ccf97b3a2
|
data/README.md
CHANGED
|
@@ -109,3 +109,18 @@ Unidom::Common.configure do |options|
|
|
|
109
109
|
|
|
110
110
|
end
|
|
111
111
|
```
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
## RSpec examples
|
|
116
|
+
|
|
117
|
+
```ruby
|
|
118
|
+
# spec/models/unidom_spec.rb
|
|
119
|
+
require 'unidom/contact/models_rspec'
|
|
120
|
+
|
|
121
|
+
# spec/types/unidom_spec.rb
|
|
122
|
+
require 'unidom/contact/types_rspec'
|
|
123
|
+
|
|
124
|
+
# spec/validators/unidom_spec.rb
|
|
125
|
+
require 'unidom/contact/validators_rspec'
|
|
126
|
+
```
|
|
@@ -8,8 +8,6 @@ class Unidom::Contact::ContactSubscription < Unidom::Contact::ApplicationRecord
|
|
|
8
8
|
include Unidom::Common::Concerns::ModelExtension
|
|
9
9
|
|
|
10
10
|
validates :name, presence: true, length: { in: 2..self.columns_hash['name'].limit }
|
|
11
|
-
validates :grade, presence: true, numericality: { only_integer: true, greater_than_or_equal_to: 0, less_than_or_equal_to: 1000 }
|
|
12
|
-
validates :priority, presence: true, numericality: { only_integer: true, greater_than_or_equal_to: 0, less_than_or_equal_to: 1000 }
|
|
13
11
|
|
|
14
12
|
belongs_to :contact, polymorphic: true
|
|
15
13
|
belongs_to :subscriber, polymorphic: true
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
describe Unidom::Contact::ContactSubscription, type: :model do
|
|
2
|
+
|
|
3
|
+
before :each do
|
|
4
|
+
end
|
|
5
|
+
|
|
6
|
+
after :each do
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
context do
|
|
10
|
+
|
|
11
|
+
model_attributes = {
|
|
12
|
+
contact_id: SecureRandom.uuid,
|
|
13
|
+
contact_type: 'Unidom::Contact::Contact::Mock',
|
|
14
|
+
subscriber_id: SecureRandom.uuid,
|
|
15
|
+
subscriber_type: 'Unidom::Contact::Subscriber::Mock',
|
|
16
|
+
name: 'Home'
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes
|
|
20
|
+
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
describe Unidom::Contact::EmailAddress, type: :model do
|
|
2
|
+
|
|
3
|
+
before :each do
|
|
4
|
+
end
|
|
5
|
+
|
|
6
|
+
after :each do
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
context do
|
|
10
|
+
|
|
11
|
+
model_attributes = {
|
|
12
|
+
personalized_name: 'Tim Jason',
|
|
13
|
+
full_address: 'tim.jason@company.com'
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes
|
|
17
|
+
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
end
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
require 'rspec/models/unidom/contact/contact_subscription_spec' unless Unidom::Common::Neglection.namespace_neglected? 'Unidom::Contact::ContactSubscription'
|
|
2
|
+
require 'rspec/models/unidom/contact/email_address_spec' unless Unidom::Common::Neglection.namespace_neglected? 'Unidom::Contact::EmailAddress'
|
|
File without changes
|
|
File without changes
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: unidom-contact
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: '1.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-01-
|
|
11
|
+
date: 2017-01-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: unidom-common
|
|
@@ -53,9 +53,14 @@ files:
|
|
|
53
53
|
- config/routes.rb
|
|
54
54
|
- db/migrate/20010301000000_create_unidom_contact_subscriptions.rb
|
|
55
55
|
- db/migrate/20010302000000_create_unidom_email_addresses.rb
|
|
56
|
+
- lib/rspec/models/unidom/contact/contact_subscription_spec.rb
|
|
57
|
+
- lib/rspec/models/unidom/contact/email_address_spec.rb
|
|
56
58
|
- lib/tasks/contact_tasks.rake
|
|
57
59
|
- lib/unidom/contact.rb
|
|
58
60
|
- lib/unidom/contact/engine.rb
|
|
61
|
+
- lib/unidom/contact/models_rspec.rb
|
|
62
|
+
- lib/unidom/contact/types_rspec.rb
|
|
63
|
+
- lib/unidom/contact/validators_rspec.rb
|
|
59
64
|
- lib/unidom/contact/version.rb
|
|
60
65
|
homepage: https://github.com/topbitdu/unidom-contact
|
|
61
66
|
licenses:
|