0
@@ -110,41 +110,38 @@ class StateMachineInitialStatesTest < ActiveModel::TestCase
0
assert_equal :read, @foo.current_state(:bar)
0
-#describe AASM, '- event firing with persistence' do
0
-# it 'should fire the Event' do
0
-# Foo.aasm_events[:close].should_receive(:fire).with(foo)
0
-# it 'should update the current state' do
0
-# foo.aasm_current_state.should == :closed
0
-# it 'should call the success callback if one was provided' do
0
-# foo.should_receive(:success_callback)
0
-# it 'should attempt to persist if aasm_write_state is defined' do
0
-# def foo.aasm_write_state
0
-# foo.should_receive(:aasm_write_state)
0
+class StateMachineEventFiringWithPersistenceTest < ActiveModel::TestCase
0
+ @subj = StateMachineSubject.new
0
+ test 'updates the current state' do
0
+ assert_equal :closed, @subj.current_state
0
+ uses_mocha "StateMachineEventFiringWithPersistenceTest with callbacks" do
0
+ test 'fires the Event' do
0
+ @subj.class.state_machine.events[:close].expects(:fire).with(@subj)
0
+ test 'calls the success callback if one was provided' do
0
+ @subj.expects(:success_callback)
0
+ test 'attempts to persist if write_state is defined' do
0
+ @subj.expects(:write_state)
0
class StateMachineEventFiringWithoutPersistence < ActiveModel::TestCase
0
test 'updates the current state' do
0
@@ -162,30 +159,32 @@ class StateMachineEventFiringWithoutPersistence < ActiveModel::TestCase
0
- test '
should attempt to persist if aasm_write_state is defined' do
0
+ test '
attempts to persist if write_state is defined' do
0
subj = StateMachineSubject.new
0
- def subj.
aasm_write_state
0
- subj.expects(:
aasm_write_state_without_persistence)
0
+ subj.expects(:
write_state_without_persistence)
0
-#describe AASM, '- persistence' do
0
-# it 'should read the state if it has not been set and aasm_read_state is defined' do
0
-# def foo.aasm_read_state
0
-# foo.should_receive(:aasm_read_state)
0
-# foo.aasm_current_state
0
+uses_mocha 'StateMachinePersistenceTest' do
0
+ class StateMachinePersistenceTest < ActiveModel::TestCase
0
+ test 'reads the state if it has not been set and read_state is defined' do
0
+ subj = StateMachineSubject.new
0
+ subj.expects(:read_state).with(StateMachineSubject.state_machine)
0
uses_mocha 'StateMachineEventCallbacksTest' do
0
class StateMachineEventCallbacksTest < ActiveModel::TestCase
Comments
No one has commented yet.