1
0
Fork 0
mirror of https://github.com/aasm/aasm synced 2023-03-27 23:22:41 -04:00

coverage for event fired/failed method when using non-! methods

This commit is contained in:
Scott Barron 2008-05-30 16:33:27 -07:00
parent 83bbe4d082
commit 0ee1ad986f

View file

@ -190,7 +190,7 @@ describe AASM, '- getting events for a state' do
end
describe AASM, '- event callbacks' do
it 'should call aasm_event_fired if defined and successful' do
it 'should call aasm_event_fired if defined and successful for bang fire' do
foo = Foo.new
def foo.aasm_event_fired(from, to)
end
@ -200,7 +200,17 @@ describe AASM, '- event callbacks' do
foo.close!
end
it 'should call aasm_event_failed if defined and transition failed' do
it 'should call aasm_event_fired if defined and successful for non-bang fire' do
foo = Foo.new
def foo.aasm_event_fired(from, to)
end
foo.should_receive(:aasm_event_fired)
foo.close
end
it 'should call aasm_event_failed if defined and transition failed for bang fire' do
foo = Foo.new
def foo.aasm_event_failed(event)
end
@ -209,6 +219,16 @@ describe AASM, '- event callbacks' do
foo.null!
end
it 'should call aasm_event_failed if defined and transition failed for non-bang fire' do
foo = Foo.new
def foo.aasm_event_failed(event)
end
foo.should_receive(:aasm_event_failed)
foo.null
end
end