unidom-product 1.6.2 → 1.7
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/lib/rspec/models/unidom/product/product_associating_spec.rb +23 -0
- data/lib/rspec/models/unidom/product/product_spec.rb +23 -0
- data/lib/rspec/types/unidom/product/formset_spec.rb +14 -0
- data/lib/rspec/types/unidom/product/product_association_spec.rb +15 -0
- data/lib/unidom/product/models_rspec.rb +2 -0
- data/lib/unidom/product/types_rspec.rb +2 -0
- data/lib/unidom/product/validators_rspec.rb +0 -0
- data/lib/unidom/product/version.rb +1 -1
- metadata +9 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6112721afc19bb40e2144f18f67f9ea27a22d611
|
|
4
|
+
data.tar.gz: ed6a2b7042fd94b97c1937d72d8269801f928817
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 089ec3c029c5cdff0ca5131daca1a77fded2327cbb9bb6b6fe2d1740a81f16e29fcc61d3232bc7d3bd2923531ee5095ec98bbe86f9754e447052a5e97371c5b7
|
|
7
|
+
data.tar.gz: aea251e470da8b1c3a8a4b99090782a994863126254ed95a605026b1e388c10c6004502635638c7f5babf4d70ccc8d0c77080a047dbf8ed2630bbb7a35b7ff27
|
data/README.md
CHANGED
|
@@ -118,3 +118,18 @@ Unidom::Common.configure do |options|
|
|
|
118
118
|
|
|
119
119
|
end
|
|
120
120
|
```
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
## RSpec examples
|
|
125
|
+
|
|
126
|
+
```ruby
|
|
127
|
+
# spec/models/unidom_spec.rb
|
|
128
|
+
require 'unidom/product/models_rspec'
|
|
129
|
+
|
|
130
|
+
# spec/types/unidom_spec.rb
|
|
131
|
+
require 'unidom/product/types_rspec'
|
|
132
|
+
|
|
133
|
+
# spec/validators/unidom_spec.rb
|
|
134
|
+
require 'unidom/product/validators_rspec'
|
|
135
|
+
```
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
describe Unidom::Product::ProductAssociating, 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
|
+
source_id: SecureRandom.uuid,
|
|
13
|
+
target_id: SecureRandom.uuid,
|
|
14
|
+
product_association_code: Unidom::Product::ProductAssociation::COMPLEMENT.code,
|
|
15
|
+
ordinal: 1,
|
|
16
|
+
quantity: 2
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes
|
|
20
|
+
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
describe Unidom::Product::Product, 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
|
+
name: 'Model X',
|
|
13
|
+
abbreviation: 'MX',
|
|
14
|
+
measurement_unit: 'car',
|
|
15
|
+
packing_norm: '1 car',
|
|
16
|
+
formset_code: 'WARE'
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes
|
|
20
|
+
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
describe Unidom::Product::Formset, type: :type do
|
|
2
|
+
|
|
3
|
+
before :each do
|
|
4
|
+
end
|
|
5
|
+
|
|
6
|
+
after :each do
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
it_behaves_like 'ProgneTapera::EnumConfig', 3, [
|
|
10
|
+
{ code: 'WARE', name: 'ware', localized_name: '货物' },
|
|
11
|
+
{ code: 'SRVC', name: 'service', localized_name: '服务' },
|
|
12
|
+
{ code: 'PTFL', name: 'portfolio', localized_name: '组合' } ]
|
|
13
|
+
|
|
14
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
describe Unidom::Product::ProductAssociation, type: :type do
|
|
2
|
+
|
|
3
|
+
before :each do
|
|
4
|
+
end
|
|
5
|
+
|
|
6
|
+
after :each do
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
it_behaves_like 'ProgneTapera::EnumConfig', 4, [
|
|
10
|
+
{ code: 'CPLM', name: 'complement', localized_name: '补充' },
|
|
11
|
+
{ code: 'ICPT', name: 'incompatibility', localized_name: '不兼容' },
|
|
12
|
+
{ code: 'OBSL', name: 'obsolescence', localized_name: '废弃' },
|
|
13
|
+
{ code: 'SBST', name: 'substitute', localized_name: '替代' } ]
|
|
14
|
+
|
|
15
|
+
end
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
require 'rspec/models/unidom/product/product_spec' unless Unidom::Common::Neglection.namespace_neglected? 'Unidom::Product::Product'
|
|
2
|
+
require 'rspec/models/unidom/product/product_associating_spec' unless Unidom::Common::Neglection.namespace_neglected? 'Unidom::Product::ProductAssociating'
|
|
File without changes
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: unidom-product
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: '1.7'
|
|
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-02-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: unidom-common
|
|
@@ -58,9 +58,16 @@ files:
|
|
|
58
58
|
- config/routes.rb
|
|
59
59
|
- db/migrate/20020201000000_create_unidom_products.rb
|
|
60
60
|
- db/migrate/20020211000000_create_unidom_product_associatings.rb
|
|
61
|
+
- lib/rspec/models/unidom/product/product_associating_spec.rb
|
|
62
|
+
- lib/rspec/models/unidom/product/product_spec.rb
|
|
63
|
+
- lib/rspec/types/unidom/product/formset_spec.rb
|
|
64
|
+
- lib/rspec/types/unidom/product/product_association_spec.rb
|
|
61
65
|
- lib/tasks/product_tasks.rake
|
|
62
66
|
- lib/unidom/product.rb
|
|
63
67
|
- lib/unidom/product/engine.rb
|
|
68
|
+
- lib/unidom/product/models_rspec.rb
|
|
69
|
+
- lib/unidom/product/types_rspec.rb
|
|
70
|
+
- lib/unidom/product/validators_rspec.rb
|
|
64
71
|
- lib/unidom/product/version.rb
|
|
65
72
|
homepage: https://github.com/topbitdu/unidom-product
|
|
66
73
|
licenses:
|