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

Some specs for #aasm_events_for_current_state

This commit is contained in:
Scott Barron 2008-03-02 07:33:37 -05:00
parent 32156165d4
commit 29304c70ae
2 changed files with 15 additions and 1 deletions

1
TODO
View file

@ -9,6 +9,5 @@ Cool ideas from users:
* Support multiple state machines on one object (Chris Nelson)
* http://justbarebones.blogspot.com/2007/11/actsasstatemachine-enhancements.html (Chetan Patil)
* next_events_for_current_state (Nick Plante)
* transition logging (Artem Vasiliev)
* timestamp column for state change on AR (Mike Ferrier)

View file

@ -107,3 +107,18 @@ describe AASM, '- persistence' do
foo.aasm_current_state
end
end
describe AASM, '- getting events for a state' do
it '#aasm_events_for_current_state should use current state' do
foo = Foo.new
foo.should_receive(:aasm_current_state)
foo.aasm_events_for_current_state
end
it '#aasm_events_for_current_state should use aasm_events_for_state' do
foo = Foo.new
foo.stub!(:aasm_current_state).and_return(:foo)
foo.should_receive(:aasm_events_for_state).with(:foo)
foo.aasm_events_for_current_state
end
end