aasm 3.0.14 → 3.0.15

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.
@@ -1,33 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe 'callbacks for the new DSL' do
4
- before(:each) do
5
- @callback = CallbackNewDsl.new
6
- end
7
-
8
- it "should get close callbacks" do
9
- @callback.should_receive(:before).once.ordered
10
- @callback.should_receive(:before_exit_open).once.ordered # these should be before the state changes
11
- @callback.should_receive(:before_enter_closed).once.ordered
12
- @callback.should_receive(:aasm_write_state).once.ordered.and_return(true) # this is when the state changes
13
- @callback.should_receive(:after_exit_open).once.ordered # these should be after the state changes
14
- @callback.should_receive(:after_enter_closed).once.ordered
15
- @callback.should_receive(:after).once.ordered
16
-
17
- @callback.close!
18
- end
19
-
20
- it "should get open callbacks" do
21
- @callback.close!
22
-
23
- @callback.should_receive(:before).once.ordered
24
- @callback.should_receive(:before_exit_closed).once.ordered # these should be before the state changes
25
- @callback.should_receive(:before_enter_open).once.ordered
26
- @callback.should_receive(:aasm_write_state).once.ordered.and_return(true) # this is when the state changes
27
- @callback.should_receive(:after_exit_closed).once.ordered # these should be after the state changes
28
- @callback.should_receive(:after_enter_open).once.ordered
29
- @callback.should_receive(:after).once.ordered
30
-
31
- @callback.open!
32
- end
33
- end
@@ -1,33 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe 'callbacks for the old DSL' do
4
- before(:each) do
5
- @callback = CallbackOldDsl.new
6
- end
7
-
8
- it "should get close callbacks" do
9
- @callback.should_receive(:before).once.ordered
10
- @callback.should_receive(:before_exit_open).once.ordered # these should be before the state changes
11
- @callback.should_receive(:before_enter_closed).once.ordered
12
- @callback.should_receive(:aasm_write_state).once.ordered.and_return(true) # this is when the state changes
13
- @callback.should_receive(:after_exit_open).once.ordered # these should be after the state changes
14
- @callback.should_receive(:after_enter_closed).once.ordered
15
- @callback.should_receive(:after).once.ordered
16
-
17
- @callback.close!
18
- end
19
-
20
- it "should get open callbacks" do
21
- @callback.close!
22
-
23
- @callback.should_receive(:before).once.ordered
24
- @callback.should_receive(:before_exit_closed).once.ordered # these should be before the state changes
25
- @callback.should_receive(:before_enter_open).once.ordered
26
- @callback.should_receive(:aasm_write_state).once.ordered.and_return(true) # this is when the state changes
27
- @callback.should_receive(:after_exit_closed).once.ordered # these should be after the state changes
28
- @callback.should_receive(:after_enter_open).once.ordered
29
- @callback.should_receive(:after).once.ordered
30
-
31
- @callback.open!
32
- end
33
- end