unidom-price 1.6.2 → 1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +15 -0
- data/lib/rspec/models/unidom/price/price_spec.rb +27 -0
- data/lib/rspec/types/unidom/price/calculation_spec.rb +13 -0
- data/lib/rspec/types/unidom/price/charging_spec.rb +14 -0
- data/lib/rspec/types/unidom/price/pricing_spec.rb +15 -0
- data/lib/unidom/price/models_rspec.rb +1 -0
- data/lib/unidom/price/types_rspec.rb +3 -0
- data/lib/unidom/price/validators_rspec.rb +0 -0
- data/lib/unidom/price/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: f9ea0654651dc5f83da9c6db9a1f6c1f295269c6
|
4
|
+
data.tar.gz: a749049b61d858d09bfef3573c360326b1035e69
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad3bb9bd6b6d1924daf677821c127961452400f5cb9bf3904090ef63b38e5eaaae02cf0313dd3db452da743e4dbd9216ad15639cafffd2731464de5f39a26008
|
7
|
+
data.tar.gz: 4e05f4266915578ada354ffad4809143318fe9c2c93ccad5456d656bc1f8d12b224e0661d402d0109fea02edbd9c1b6eadc76d71e73f43719830a3ef265b8278
|
data/README.md
CHANGED
@@ -141,3 +141,18 @@ Unidom::Common.configure do |options|
|
|
141
141
|
|
142
142
|
end
|
143
143
|
```
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
## RSpec examples
|
148
|
+
|
149
|
+
```ruby
|
150
|
+
# spec/models/unidom_spec.rb
|
151
|
+
require 'unidom/price/models_rspec'
|
152
|
+
|
153
|
+
# spec/types/unidom_spec.rb
|
154
|
+
require 'unidom/price/types_rspec'
|
155
|
+
|
156
|
+
# spec/validators/unidom_spec.rb
|
157
|
+
require 'unidom/price/validators_rspec'
|
158
|
+
```
|
@@ -0,0 +1,27 @@
|
|
1
|
+
describe Unidom::Price::Price, 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
|
+
priced_id: SecureRandom.uuid,
|
13
|
+
priced_type: 'Unidom::Price::Priced::Mock',
|
14
|
+
pricer_id: SecureRandom.uuid,
|
15
|
+
pricer_type: 'Unidom::Price::Pricer::Mock',
|
16
|
+
calculation_code: 'AMNT',
|
17
|
+
pricing_code: 'BASE',
|
18
|
+
charging_code: 'ONCE',
|
19
|
+
currency_code: 'RMB',
|
20
|
+
amount: 10.00
|
21
|
+
}
|
22
|
+
|
23
|
+
it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
describe Unidom::Price::Calculation, type: :type do
|
2
|
+
|
3
|
+
before :each do
|
4
|
+
end
|
5
|
+
|
6
|
+
after :each do
|
7
|
+
end
|
8
|
+
|
9
|
+
it_behaves_like 'ProgneTapera::EnumConfig', 2, [
|
10
|
+
{ code: 'AMNT', name: 'amount', localized_name: '金额' },
|
11
|
+
{ code: 'PCTG', name: 'percentage', localized_name: '百分比' } ]
|
12
|
+
|
13
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
describe Unidom::Price::Charging, 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: 'ONCE', name: 'one_time', localized_name: '一次性收费' },
|
11
|
+
{ code: 'RECR', name: 'recurring', localized_name: '重复性收费' },
|
12
|
+
{ code: 'UTLZ', name: 'utilization', localized_name: '使用率收费' } ]
|
13
|
+
|
14
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
describe Unidom::Price::Pricing, 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: 'BASE', name: 'base', localized_name: '基价' },
|
11
|
+
{ code: 'DSCT', name: 'discount', localized_name: '折扣成分' },
|
12
|
+
{ code: 'SCHG', name: 'surcharge', localized_name: '额外收费成分' },
|
13
|
+
{ code: 'MFSG', name: 'manufacturer_suggested', localized_name: '厂家建议价' } ]
|
14
|
+
|
15
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'rspec/models/unidom/price/price_spec' unless Unidom::Common::Neglection.namespace_neglected? 'Unidom::Price::Price'
|
File without changes
|
data/lib/unidom/price/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unidom-price
|
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
|
@@ -54,9 +54,16 @@ files:
|
|
54
54
|
- config/locales/enum.zh-CN.yml
|
55
55
|
- config/routes.rb
|
56
56
|
- db/migrate/20020301000000_create_unidom_prices.rb
|
57
|
+
- lib/rspec/models/unidom/price/price_spec.rb
|
58
|
+
- lib/rspec/types/unidom/price/calculation_spec.rb
|
59
|
+
- lib/rspec/types/unidom/price/charging_spec.rb
|
60
|
+
- lib/rspec/types/unidom/price/pricing_spec.rb
|
57
61
|
- lib/tasks/price_tasks.rake
|
58
62
|
- lib/unidom/price.rb
|
59
63
|
- lib/unidom/price/engine.rb
|
64
|
+
- lib/unidom/price/models_rspec.rb
|
65
|
+
- lib/unidom/price/types_rspec.rb
|
66
|
+
- lib/unidom/price/validators_rspec.rb
|
60
67
|
- lib/unidom/price/version.rb
|
61
68
|
homepage: https://github.com/topbitdu/unidom-price
|
62
69
|
licenses:
|