canmoia 0.1.0 → 0.2.0
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/Gemfile.lock +1 -1
- data/lib/canmoia/concerns/order.rb +1 -1
- data/lib/canmoia/version.rb +1 -1
- data/spec/concerns/order_spec.rb +1 -41
- data/spec/dummy/app/models/item.rb +6 -1
- data/spec/dummy/log/test.log +1207 -0
- data/spec/fabricators/item_fabricator.rb +2 -2
- data/spec/support/example_groups/canmoia_order_group.rb +41 -0
- data/tmp/rspec_guard_result +1 -1
- metadata +4 -4
- data/spec/#spec_helper.rb# +0 -46
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e4c453d322fe080628f605775108e772b2685c0
|
4
|
+
data.tar.gz: aaa2dd4499796ec14225df35b78ae1db526c46bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c3673e2a8e7030067105407e9cea4b1265d98f0d58cba99bae65d78d22d2c23bfa712304c879d451c616dc08a71b922e0590a2741b3ad5b5d0c7f1716b6a4a8
|
7
|
+
data.tar.gz: a6551ff43d60fa636f6fa923e3030095f093acd39e144a2c31db1e1cd122e2a4756152758bcdab12822451cea8b37c8b4fdf0bf71d0c2b139c57e9019f9ee2b9
|
data/Gemfile.lock
CHANGED
data/lib/canmoia/version.rb
CHANGED
data/spec/concerns/order_spec.rb
CHANGED
@@ -1,45 +1,5 @@
|
|
1
1
|
require 'spec_helper.rb'
|
2
2
|
|
3
3
|
describe Canmoia::Order do
|
4
|
-
|
5
|
-
it 'should include Camnoia::Order module ' do
|
6
|
-
order = Fabricate :order
|
7
|
-
order.class.included_modules.should include Canmoia::Order
|
8
|
-
end
|
9
|
-
|
10
|
-
it 'should define core domain states for a Order' do
|
11
|
-
order = Fabricate :order # Order class must include Canmoia::Order
|
12
|
-
order.should respond_to :opened?
|
13
|
-
order.should respond_to :reviewing?
|
14
|
-
order.should respond_to :accepted?
|
15
|
-
order.should respond_to :rejected?
|
16
|
-
order.should respond_to :canceled?
|
17
|
-
order.should respond_to :completed?
|
18
|
-
end
|
19
|
-
|
20
|
-
it 'should compute total value in opened state ' do
|
21
|
-
order = Fabricate :order
|
22
|
-
first_item = order.items.first
|
23
|
-
|
24
|
-
order.items.sum(&:value).should == order.total
|
25
|
-
|
26
|
-
first_item.value += 1
|
27
|
-
|
28
|
-
order.items.sum(&:value).should == order.total + 1
|
29
|
-
end
|
30
|
-
|
31
|
-
it 'should not compute total value after opened state' do
|
32
|
-
order = Fabricate :order
|
33
|
-
first_item = order.items.first
|
34
|
-
|
35
|
-
order.close!
|
36
|
-
|
37
|
-
closed_total = order.total
|
38
|
-
|
39
|
-
first_item.value += 1
|
40
|
-
|
41
|
-
order.total.should == closed_total
|
42
|
-
end
|
43
|
-
|
44
|
-
# it 'should ignore workflow_column call if workflow_column already called'
|
4
|
+
it_should_behave_like :canmoia_order
|
45
5
|
end
|