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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 36acb2cd892d976aa1d11beef496a1dd55892da5
4
- data.tar.gz: 9e6a626e4643dfcb881617bab300156e707258ba
3
+ metadata.gz: f9ea0654651dc5f83da9c6db9a1f6c1f295269c6
4
+ data.tar.gz: a749049b61d858d09bfef3573c360326b1035e69
5
5
  SHA512:
6
- metadata.gz: 1e0358cf0fe1bd5696ce08f064e22a85cff7a54185d58169000d2a3aa15f4a23c7f87c1ee83a5d13a82a5443673f8d3f3cfae4ea34983e4f892c6ef9bb7a2362
7
- data.tar.gz: 7849b672fe3205340507680b0a1e9708a6614a9cd6354580009e47cf5dec1132eb35755677293dd5790c45335172fd453d89d02853e52f4ced4a7a4732b453dd
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'
@@ -0,0 +1,3 @@
1
+ require 'rspec/types/unidom/price/calculation_spec'
2
+ require 'rspec/types/unidom/price/charging_spec'
3
+ require 'rspec/types/unidom/price/pricing_spec'
File without changes
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Price
3
- VERSION = '1.6.2'.freeze
3
+ VERSION = '1.7'.freeze
4
4
  end
5
5
  end
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.6.2
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-21 00:00:00.000000000 Z
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: