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: aeab6cd86ed792d5475a58e4469f828fd30ff5fd
4
- data.tar.gz: bd240520ac7e134f98a260be212630c42c330c05
3
+ metadata.gz: 7a4a97f360a518453763d51712a80997ffdf5732
4
+ data.tar.gz: 963e6de7450730fc759869c2a6ba86ade8e94e8d
5
5
  SHA512:
6
- metadata.gz: 5a7bbe450c789a001650bb623356f02fcf6be99c4fa9610f35ad958c9f6b86b7dafff9dc80bad93b043d291c6443e67805aa74d9a53cb896fea5f3dd067e6ecf
7
- data.tar.gz: de953d928ea9f696389b136ef0845f105a25262886d2d5d6ad3d3a2b337aab55d9a635ff835e85ba1c429aaf0abd0538f0cad2260ae1f154d31cc97b1b0e20d0
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 = {
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Price
3
- VERSION = '1.7.7'.freeze
3
+ VERSION = '1.7.8'.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.7.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 00:00:00.000000000 Z
11
+ date: 2017-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unidom-common