diff --git a/TODO b/TODO index 98231fe..a2de8f7 100644 --- a/TODO +++ b/TODO @@ -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) diff --git a/spec/unit/aasm_spec.rb b/spec/unit/aasm_spec.rb index 7498b7a..93bd1be 100644 --- a/spec/unit/aasm_spec.rb +++ b/spec/unit/aasm_spec.rb @@ -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