unidom-price 1.7.7 → 1.7.8
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: 7a4a97f360a518453763d51712a80997ffdf5732
|
4
|
+
data.tar.gz: 963e6de7450730fc759869c2a6ba86ade8e94e8d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d913e8fc30d2aa0852f4a7733888207ba4196b1651d3ff8a8e3592ad14f5a2589f8078bf2cf6b7ab702cd3faeb310277525256084b78852d1e82d365359ebbad
|
7
|
+
data.tar.gz: a638e0ec4918dd61d8565e24951c19f52aaa7c166f77ac024bb257534bce9ad40bcac2b81f9d7408ec46a5073edfae4c6e15424e991416c3a15e3ce4ddcc7e71
|
@@ -1,5 +1,47 @@
|
|
1
1
|
shared_examples 'Unidom::Price::Concerns::AsPricer' do |model_attributes, priced|
|
2
2
|
|
3
|
+
before :each do
|
4
|
+
@pricer = described_class.create! model_attributes
|
5
|
+
@amount = 10.00
|
6
|
+
end
|
7
|
+
|
8
|
+
after :each do
|
9
|
+
end
|
10
|
+
|
11
|
+
context '#price!' do
|
12
|
+
|
13
|
+
it "should be able to price #{priced.inspect} with amount #{@amount.inspect}" do
|
14
|
+
price = @pricer.price! priced, @amount
|
15
|
+
expect(price).to be_present
|
16
|
+
expect(price).to be_a(Unidom::Price::Price)
|
17
|
+
expect(price).not_to be_new_record
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should be able to price #{priced.inspect} with amount #{@amount.inspect} at #{Time.now.inspect}" do
|
21
|
+
price = @pricer.price! priced, @amount, at: Time.now
|
22
|
+
expect(price).to be_present
|
23
|
+
expect(price).to be_a(Unidom::Price::Price)
|
24
|
+
expect(price).not_to be_new_record
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
|
29
|
+
context '#price?' do
|
30
|
+
|
31
|
+
it "should be able to price #{priced.inspect} with amount #{@amount.inspect}" do
|
32
|
+
expect(@pricer.price? priced).to be_falsey
|
33
|
+
@pricer.price! priced, @amount
|
34
|
+
expect(@pricer.price? priced).to be_truthy
|
35
|
+
end
|
36
|
+
|
37
|
+
it "should be able to price #{priced.inspect} with amount #{@amount.inspect} at #{Time.now.inspect}" do
|
38
|
+
expect(@pricer.price? priced, at: Time.now).to be_falsey
|
39
|
+
@pricer.price! priced, @amount, at: Time.now
|
40
|
+
expect(@pricer.price? priced, at: Time.now).to be_truthy
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
44
|
+
|
3
45
|
context do
|
4
46
|
|
5
47
|
price_1_attribtues = {
|
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.7.
|
4
|
+
version: 1.7.8
|
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-04-
|
11
|
+
date: 2017-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unidom-common
|